Question
· Jun 28, 2018

reload or clear zen Datacombo

Hi there,

is there a way to reload or clear the content to zen dataCombo from a ZenMethod

Discussion (1)0
Log in or sign up to continue

To execute load it in Samples namespace:

===========================================================================================

Class ZENTest.ComboTest1 Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace = "http://www.intersystems.com/zen]
{
<page xmlns="http://www.intersystems.com/zenxmlns:demo="http://www.intersystems.com/zendemotitle="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('')>
}

}
============================================================================================