Posts:
Vladimir has not published any posts yet.
Replies:

There are two ways - via client or server method:

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

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

/// Load it in Samples Namespace
/// 
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>
<group id="group">
</group>
<spacer width="200"/>
<dataCombo id="dataCombo1"
label="dataCombo1" name="dataCombo1"
editable="true"
  unrestricted="true"
searchKeyLen="0"
choiceColumn="1"
valueColumn="2"
maxRows="10000"
displayColumns="1,4,3"
dropdownWidth="50.0em"
sql="SELECT Name,ID,Title,SSN FROM ZENDemo_Data.Employee ORDER BY Name "
columnHeaders="Name,SSN,Title">
</dataCombo>
</hgroup>
</page>
}

ClientMethod onloadHandler() [ Language = javascript ]
{
   zenSetProp('dataCombo1','value', 'Adam,Lisa H.' );
   ///zenSetProp('dataCombo','value', "Please make a choice." );
}

Method %OnAfterCreatePage() As %Status [ GenerateAfter = %OnAfterCreatePage ]
{
   Set tHolder = %page.%GetComponentById("group")
    set tComp = ##class(%ZEN.Component.dataCombo).%New()
    set tComp.id = "dataCombo"
set tComp.label = "dataCombo"
set tComp.value = "Alton,George D."
/// set tComp.value = "Please make a choice"
set tComp.maxRows="10000"
set tComp.dropdownWidth="50.0em"
set tComp.valueColumn="2"
set tComp.choiceColumn="1"
set tComp.sql = "SELECT Name,ID,Title,SSN FROM ZENDemo_Data.Employee ORDER BY Name"
If $IsObject(tComp) {
Do tHolder.%AddChild(tComp)
}
&js<zen('dataCombo1').executeQuery();>
    Quit $$$OK
}

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

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('')>
}

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

Filters work exactly this way (take a look at ZENTest.TableTest.cls in Samples namespace), but:

"Filtering works only if the <tablePane> is using an automatically generated SQL statement or an OnCreateResultSet callback"

Followers:
Vladimir has no followers yet.
Following:
Vladimir has not followed anybody yet.
Global Masters badges:
Vladimir has no Global Masters badges yet.