guyr
06-27-2007, 01:32 PM
In our environment, users have different capabilities based on permissions assigned to their logon ids. Our existing implementation is JSP, and including or excluding different parts of the GUI is pretty straightforward; basically, you can define an "if" condition in a scriplet (chunk of Java code) that surrounds the HTML to conditionally include.
From searching the forum, the way to build such a conditionalized GUI in OL4 today is by building the interface in script instead of with tags. But as the OL4 documentation itself states, OL was designed primarily as a tag-based platform, and indeed in my short time with it the declarative form of the interface definition is straightforward and powerful. A further impetus in this direction is for teams with dedicated GUI designers; tag-based interfaces are more intuitive for the creative types.
So this wishlist item is to figure out some way to be able to conditionalize the GUI while still maintaining the declarative implementation as much as possible. I haven't really thought up a mechanism to do this. I found the following idea in a forum post:
What you mention is pretty much how databinding works in Laszlo. For example, the below "Next" button will ony be displayed if its datapath matches what's in the dataset.
<button datapath="dsInterview:/Page/Navigation[@Type='Next']" text="Next" />
But this doesn't appear to be generally extensible. The content of a component is typically independent of it's visibility. Perhaps an "if"/"unless" attribute can be added to all components derived from view:
<view id="x" if="condition"/>
If the run time condition is false, the view and all it's children are not instantiated. The condition would be Javascript.
From searching the forum, the way to build such a conditionalized GUI in OL4 today is by building the interface in script instead of with tags. But as the OL4 documentation itself states, OL was designed primarily as a tag-based platform, and indeed in my short time with it the declarative form of the interface definition is straightforward and powerful. A further impetus in this direction is for teams with dedicated GUI designers; tag-based interfaces are more intuitive for the creative types.
So this wishlist item is to figure out some way to be able to conditionalize the GUI while still maintaining the declarative implementation as much as possible. I haven't really thought up a mechanism to do this. I found the following idea in a forum post:
What you mention is pretty much how databinding works in Laszlo. For example, the below "Next" button will ony be displayed if its datapath matches what's in the dataset.
<button datapath="dsInterview:/Page/Navigation[@Type='Next']" text="Next" />
But this doesn't appear to be generally extensible. The content of a component is typically independent of it's visibility. Perhaps an "if"/"unless" attribute can be added to all components derived from view:
<view id="x" if="condition"/>
If the run time condition is false, the view and all it's children are not instantiated. The condition would be Javascript.