Hi. Can you give some idea how to use query result to satisfy a functional restriction in application.? For example i have a query that checks user privileges and returns 0 or 1. Based on returned value I need some buttons to be visible and the others to be hidden. How to implement this?
asked 08 Apr '13, 05:18
To implement this, you can use postInitialize event of the panel. This event triggers only once, just after the initialization of the panel. In this event, you can hide necessary buttons existing in this panel using api_component.setVisible API and satisfy the functional restriction.
You may think about why defining a postInitialize event for every single panel to be functionally restricted and why not to hide all buttons existing in the application(in all panels) when the user just logged in for example. The answer is the following:
Formspider doesn't initialize(load) the entire application when it's started, instead, it initializes a panel(screen) when it's necessary, it's one of the performance related advantages that Formspider provides.
In Formspider, the initialization of a panel is necessary when it's displayed on the screen for the first time or when any of the components existing in this panel or the panel itself is accessed through an API call. Therefore, if you hide a button component existing in a panel just at the start of the application, you will cause this panel to be initialized too early (and possibly unnecessarily since it may not be displayed on the screen).
Therefore, the best place to satisfy the functional restrictions is the postIntialize event of the panel since it triggers only once and only when it's necessary, when your panel is initialized.
Hope this helps,
answered 08 Apr '13, 06:39
Ibrahim Sand... ♦♦