View source | View content page | Page history | Printable version   
Main Page
Upload file
What links here
Recent changes

PDF Books
Show collection (0 pages)
Collections help


Projects:Attachment icon/Technical Documentation


Show attachment status with icon - Technical Documentation


Function which checks the attachments

In is placed hasAttachments method that return true if the record has attachments or false if it hasn't.

 public static boolean hasAttachments(ConnectionProvider conn, VariablesSecureApp vars, String strTab, String recordId) throws IOException, ServletException {
   TabAttachmentsData[] data = TabAttachmentsData.selectTabInfo(conn, strTab);
   String tableId = "";
   if (data==null || data.length==0) throw new ServletException("Tab not found: " + strTab);
   else tableId = data[0].adTableId;
   data =, Utility.getContext(conn, vars, "#User_Client", ""), Utility.getContext(conn, vars, "#User_Org", ""), tableId, recordId);
   if (data!=null && data.length!=0) return true;
   else return false;
 } //

Form view

Attachments checking is made when is created the toolbar class.

There is a new constructor for toolbar that has a new parameter hasAttachments of type boolean.

 void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strC_Order_ID) {
   ToolBar toolbar = new ToolBar(this, editableTab, vars.getLanguage(), "Header",
                    (strCommand.equals("NEW") || boolNew || (dataField==null && (data==null || data.length==0))),
                    "document.frmMain.inpcOrderId", "", "../RptC_Order.pdf", "N".equals("Y"), "SalesOrder", strReplaceWith,
                    true, false, false, Utility.hasAttachments(this, vars, tabId, strC_Order_ID));
 } // of SalesOrder

Grid view

There is a command CHECK implemented in, which return a page with the result of call "Utility.hasAttachments(...)" that is true or false.

The check in grids is made by the method appStatus.js/checkAttachmentIconRelation(), which makes an Ajax call to with command CHECK.

 cellClicked: function(evt) {
 goToRow: function(rowNo) {
 } //DataGrid.js

Attachments window

When loading TabAttachments_F1.html appStatus.js/checkAttachmentIcon() is executed, which makes an Ajax call to with command CHECK.

So, when an attachment is added or deleted, the attach icon is updated. This works in form and grid view.

 function onLoadDo(){
 } //TabAttachmets_F1.html

Retrieved from ""

This page has been accessed 2,339 times. This page was last modified on 8 June 2012, at 05:26. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.