I have an application which has five tables. A single table columns may be displayed in both grid and form panels. The form has multi-tab format. At the start of the application I want to set the labels, tooltip, enable/disable for different columns. How do I go ahead with this? Kindly give me some example code. I am new to formspider. Therefore, your help is greatly appreciated.
asked 24 Feb '13, 01:52
When designing a panel in the Formspider IDE, you define the initial state of the panel components via the XML editor. Labels, tooltips, enable/disable etc are all attributes to the different components. So for example you create a panel (named testPanel) with a textfield and textlabel like this:
This will give you the state at startup. If you want different runtime settings based on some rules, you can use the API's to set the properties at runtime. So for example, if you want to change the tooltip, use:
To set the label, use api_component.setLabel, to enable or disable the component, use api_component.setEnable, and so on..
The moment you want to set the new properties depends onthe use case. You can use for example the postInitialize event on a panel when you want to change the settings once on panel startup, like this:
Or on any other event you like you have control over all components attributes.
answered 24 Feb '13, 05:40
Just some more explanation about why the postIntialize event is the best place to change the panel settings:
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 necesary 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 set the label, tooltip, enable/disable state.. of any 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, as Michiel mentioned, the best place to change the panel settings is the postIntialize event of the panel. The postIntialize event triggers only once just after the panel is initialized.
You can find the APIs to set the label, tooltip, enable/disable of a component in the
answered 24 Feb '13, 05:53
Ibrahim Sand... ♦♦