Question
· Jun 23, 2021

findElement("input").value is not working

Hi Guys,

I've a combo inside a tabGroup inside a form and using :

var MyInput = zen("MyCombo").findElement("input").value;

is not finding the current input, any help pls?

 

Thanks

Product version: Ensemble 2016.1
Discussion (3)2
Log in or sign up to continue

I'd expect that to work provided the id (not name) of the combobox/dataCombo is 'MyCombo'. e.g., this works fine:

Class DC.Demo.FindElement Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace = "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen">
<form>
<tabGroup showTabBar="true">
<tab caption="Tab One">
<combobox id="MyCombo" editable="true" />
</tab>
<tab caption="Tab Two">
</tab>
</tabGroup>
</form>
<button onclick="zenPage.alertComboValue()" />
</page>
}

ClientMethod alertComboValue() [ Language = javascript ]
{
    alert(zen('MyCombo').findElement('input').value);
}

}