ERP 2.50:Developers Guide/How to change an existing window/it
Application elements (windows, tabs and fields) are liable to change repeatedly during the development or maintenance phases of a project. Openbravo ERP is able to cope with these changes because its architecture is suited to iterative development. The definitions of all generated Windows, tabs and fields are stored as metadata in the Application Dictionary (AD).
Changing the window of an existing application is a simple 2 step process comprising of two tasks: AD definition and then WAD generation.
- Use Openbravo's declarative UI to make changes to AD definition.
- Generate the working application using the Wizard for Application Development (WAD).
The generation process can be performed for the whole application or at a more granular level for individual windows.
The objective of this how-to is to illustrate how to make changes to existing generated windows in terms of appearance and behavior. The window used in the example is the Physical Inventory window and the changes illustrated will be:
- Hide a field
- Re-sequence the layout
Physical Inventory is a window that belongs to the Openbravo ERP core module. It comprises of:
- 1 Window - Physical Inventory.
- 2 Tabs - Header and Lines.
- A Header Tab has 16 Fields 13 of which are displayed.
Before any changes the header tabs has the following appearance:
Modifica della finestra
Navigate to the 'Windows, Tabs and Fields' window and select the record for 'Physical Inventory'.
Navigate to the 'Field Sequence' tab.
Nascondere un campo
Hide the 'Description' field by moving the field from the right panel (displayed) to the left panel (hidden) using the horizontal control buttons.
Save your change. You should now see the following. Alternatively you can control the display of a field through the 'Active' field in the 'Field' tab:
Ri-sequenza il layout
To change the sequence so that 'Movement Date' becomes the first field displayed use the vertical control buttons.
Save your change. Your window should display:
Compilare la finestra
Finally, for the callout to take effect, the window that uses it needs to be recompiled and deployed to Tomcat. If using Eclipse, use the eclipse.compile ant task and enter Product into the dialog that pops up. If manually compiling Openbravo ERP, use the ant compile.development -Dtab='Physical Inventory'
Important note: once the compilation has finished, restart Apache Tomcat server.
To make generate the script with the changes execute the export.config.script task. Open a command window/shell and go to the Openbravo ERP development project and then execute the following task:
See more on build tasks.
You can see in the resulting window the 'Description' field is no longer displayed and the the 'Movement Date' is the first field displayed. It's as easy as that! No code changes are needed to make these sort of window layout changes.