ERP 2.50:Developers Guide/How to change an existing window
Languages: |
Contents |
Introduction
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.
Objective
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:
Changing the window
Navigate to the 'Windows, Tabs and Fields' window and select the record for 'Physical Inventory'.
Navigate to the 'Field Sequence' tab.
Hide a field
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:
Re-sequence the 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:
Compiling the Window
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:
ant export.config.script
See more on build tasks.
The Result
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.
Languages: |
ERP 2.50:Developers Guide/How to add a field to a Window Tab | ERP 2.50:Developers Guide/How to develop a new window