Question
· Feb 1, 2018

How to display a content of the selected text from a drop down list box in zen framework.

Hi Guys,

Can you please advise me on how to display the content of the selected item/text from the drop down box listed item in our zen framework.

Thanks in advance. 

Discussion (1)1
Log in or sign up to continue
<listBox id="listBox1" label="listBox1" listWidth="150px" 
 onchange="zenPage.notifyOnChange1(zenThis);">
  <option value="1" text="Apple" />
  <option value="2" text="Banana"/>
  <option value="3" text="Cherry" />
</listBox>
<listBox id="listBox2" label="listBox2" listWidth="150px" 
 onchange="zenPage.notifyOnChange2(zenThis);">
  <option value="1" text="Apple" />
  <option value="2" text="Banana"/>
  <option value="3" text="Cherry" />
</listBox>
<text id="currValue" label="Value:"/>
<text id="currText" label="Text:"/>
</page>
}

ClientMethod notifyOnChange1(comp) [ Language = javascript ]
{
  zen('currValue').setValue(comp.getValue());
  zen('currText').setValue(comp.getProperty('text'));
}

Method notifyOnChange2(comp As %ZEN.Component.object) [ ZenMethod ]
{
  Do ..%SetValueById("currValue",comp.value)
  Do ..%SetValueById("currText",comp.text)
}