User interface programming / Split views |
Achieve a split view display with HBOX container and style attribute.
By defining a TABLE and a GRID container in a parent HBOX container, it is possible to get a splitview display by setting the splitViewRendering style attribute of the HBox class. When using this style attribute, the TABLE displays as a listview on the left of the screen, while the GRID displays as a form on the right.
LAYOUT HBOX (STYLE="splitview") TABLE { [c1 |c2 ] [c1 |c2 ] [c1 |c2 ] [c1 |c2 ] } END GRID { First name: [f1 ] Last name: [f2 ] ... } END END ...
<StyleList> <Style name="HBox.mystyle"> <StyleAttribute name="splitViewRendering" value="yes" /> </Style> ... </StyleList>
The program must implement a dialog that handles both parts of the splitview. You typically implement a DISPLAY ARRAY to handle the TABLE, and refresh the right part of the screen contained in the GRID, with code in the BEFORE ROW control block:
DISPLAY ARRAY arr TO sr.* BEFORE ROW DISPLAY arr[arr_curr()].first_name TO f_first_name DISPLAY arr[arr_curr()].last_name TO f_last_name END DISPLAY