docs.intersystems.com
MultiValue Quick Start Tutorial
Hiding, Displaying, and Loading Data into the Form
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Search:    

We want the form component to display the following behavior:

Remember that the tablePane component on PersonPage.cls already contains the following attributes:
onselectrow ="zenPage.displayForm(zenThis);"
valueColumn="ID"
Note the following about this code:
Add the following JavaScript event-handling function to PersonPage.cls. The function executes when the user selects a row on the tablePane. Be sure to place the method out-side of the XDATA Contents or XDATA Style blocks.
ClientMethod displayForm(table) [ Language = javascript ]
{
 //retrieve id column of selected row
 var id = table.getValue();
            
 //set controller to selected person
 var controller = zenPage.getComponentById('personData');
 controller.setProperty('modelId',id);
            
 //display form 
 var contactFormGroup=zenPage.getComponentById('personForm');
 contactFormGroup.setProperty('hidden',false);
}
Note the following about this code:
Note:
To learn more about zenPage and zenThis as well as other special variables, read Zen Special Variables in the Zen Application Programming section of Developing Zen Applications.


Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA