Show or hide one or more "groups" on a O4W Form-wizard designed form (Web)
Created at 16 MAY 2013 10:14AM
Show or hide one or more "groups" on a O4W Form-wizard designed form
On an O4W Form-wizard designed form, you might occasionally wish to programmatically show or hide one or more "groups" that you've defined in form definition process (for example, certain groups might contain information that's not appropriate or relevant for the current record). You can use the commuter module and O4WQualifyEvent to achieve this.
In order to implement this functionality, you must know the name of at least one field that's defined in the group. Then, using the commuterutility and that field name, we can find the section that contains the group that this field belongs in, and then show or hide the entire section, as appropriate.
* put this in the "post draw" event in the commuter module
* get a "handle" to the group that this element is part of – for example, let's pretend that the field is named REPORTS_TO, and we want to hide the entire group that contains REPORTS_TO
sectionExample = O4WCommuterUtility("", O4WUTILITY_SECTIONNAME$, "REPORTS_TO")
if sectionExample <> "" then
if bHideSection = "1" then
O4WQualifyEvent("", "hide", sectionExample) ;* we use "" in the first parameter to tell the qualify event we want the hide to take effect immediately
End else
O4WQualifyEvent("", "show", sectionExample) ;* we use "" in the first parameter to tell the qualify event we want the show to take effect immediately
End
End