setting a value for a datacombo parameter

28 views
Skip to first unread message

Andrew Makinson

unread,
Jan 31, 2017, 5:00:44 AM1/31/17
to InterSystems: Zen Community
Hi everyone,


I have a datacombo with a parameter setting.

I need to pre-populate this parameter value with a client side javascript via on onchange of another prompt - but I have not been able to do so - can anybody point me to the javascript i should use that would set the value of this parameter?

here is the datacombo


<dataCombo label="Source Application Name :" onchange="zenPage.updateSourceAppName();cached="false" sql="select code,name from Mappings_Classes.Applications where type=and valid='1'size="30" align="left" id="san" name="san">
<parameter value="" id="sanp" name="sanp" />
</dataCombo>


thanks



Vlado

unread,
Jan 31, 2017, 10:32:18 AM1/31/17
to InterSystems: Zen Community
An example:
===========================================================================================
Class ZENTest.DataCombo2DataCombo Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace = "http://www.intersystems.com/zen]
{
<page xmlns="http://www.intersystems.com/zen">
<hgroup>
<dataCombo id="dataCombo1" label="City" name="dataCombo1"
editable="true" unrestricted="true" searchKeyLen="3" dropdownWidth="15.0em"
sql="SELECT Home_City FROM ZENDemo_Data.Employee Group By Home_City ORDER BY Home_City"
onchange="zenPage.notifyOnChange(zenThis.getValue());">
</dataCombo>
<spacer width="25"/>
<dataCombo id="dataCombo2" label="Employee" name="dataCombo2"
editable="true"
  unrestricted="true"
searchKeyLen="0"
choiceColumn="1"
valueColumn="2"
maxRows="10000"
displayColumns="1,4,3,5"
dropdownWidth="50.0em"
sql="SELECT Name,ID,Title,SSN,Home_City FROM ZENDemo_Data.Employee WHERE Home_City=ORDER BY Name"
columnHeaders="Name,SSN,Title,City">
<parameter/>
</dataCombo>
</hgroup>
</page>
}

ClientMethod notifyOnChange(value) [ Language = javascript ]
{
zen('dataCombo2').setProperty('parameters',1,value)
}

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

**Владо
Reply all
Reply to author
Forward
0 new messages