יום שני, 10 בפברואר 2014

Siebel Open UI: View PRs - a Toolbar to quickly access Applets

by Jan Peterson

In a previous post we already looked at physical renderers for views. Today we look at an example that was in a similar form part of the first pre-beta demos of Open UI (yes - the version that was shown during OOW 2011 :-) ) - a toolbar of buttons where each button represents an applet.

In our example, clicking the button will collapse all other applets (which is slightly different to the OOW 2011 demo where the corresponding applet was floating to the top):

Click to enlarge
The code structure of the PM is essentially the same as in the previous example:

Click to enlarge

Most of the logic resides in SetRenderer:
Click to enlarge
First, we create two buttons - one for collapsing all applets and one for expanding all applets.
Afterwards, we iterate through all applets and make sure that they are collapsible - a trick we looked at in a previous post.

Afterwards we create a button for each applet. The button-text is the label of the applet. As a small gimmick we add the number of records in the applet to the button-text. Pressing the button calls the method CollapseApplets which will collapse all applets but the applet linked to the button.

Finally, we inject the different buttons into the view.

In summary, View PRs allow to easily add additional UI features to views. In the example we create a toolbar which simplify access to applets in complex views.

have a nice day

Jan

אין תגובות:

הוסף רשומת תגובה