Method Execute() [ ZenMethod ] { Set ctrl= ..%GetComponentById("dataCombo") Set ctrl.queryClass="ZENDemo.Data.Employee" Set ctrl.queryName="ListEmployees" &js<zen('dataCombo').executeQuery('ListEmployees')> }
Method Refresh() [ ZenMethod ] { Set ctrl= ..%GetComponentById("dataCombo") Set ctrl.queryClass="" Set ctrl.queryName="" &js<zen('dataCombo').executeQuery('')> }
To execute load it in Samples namespace:
===========================================================================================
{
XData Contents [ XMLNamespace = "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen" xmlns:demo="http://www.intersystems.com/zendemo" title="Combobox Test Page">
<hgroup align="center" labelPosition="left">
<dataCombo id="dataCombo"
label="dataCombo" name="dataCombo"
editable="true"
unrestricted="true"
searchKeyLen="3"
dropdownWidth="20.0em">
</dataCombo>
<spacer width="10"/>
<button caption="Refresh" onclick="zenPage.Refresh();" />
<spacer width="10"/>
<button caption="Execute" onclick="zenPage.Execute();" />
</hgroup>
</page>
}
Method Execute() [ ZenMethod ]
{
Set ctrl= ..%GetComponentById("dataCombo")
Set ctrl.queryClass="ZENDemo.Data.Employee"
Set ctrl.queryName="ListEmployees"
&js<zen('dataCombo').executeQuery('ListEmployees')>
}
Method Refresh() [ ZenMethod ]
{
Set ctrl= ..%GetComponentById("dataCombo")
Set ctrl.queryClass=""
Set ctrl.queryName=""
&js<zen('dataCombo').executeQuery('')>
}
}
============================================================================================