Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How to use and set its value

Question
Laura Cavanaugh · Jun 16, 2016

How to use <radioSet> and set its value

Hello,

I have a question about how to set the value of a radioSet.  Yes, I know -- the documentation says that setValue can be used "client side", but gives no example.  Plus, I'm trying to set the value of a radioSet in %onAfterCreatePage, which is a Zen method? Server side method? I'm not sure.

 

In my Zen page I create a radioSet like this:

<radioSet id="appRadio" name="appRadio" 
displayList="App One,App Two,App Three" 
valueList="One,Two,Three"/>

 

I want to select a radio based on a sepcific value, that I get from code.

e.g.

Method %OnAfterCreatePage() as %Status

set value = class.aMethodThatReturnsAValue()                                     //e.g. "Two"

set %page.GetComponentById("appRadio").setValue(value)

 

Nope.  That does not compile.

set %page.GetComponentbyId("appRaiod").value = value           //?

 

Thanks,

Laura

#ZEN #Caché

Source URL:https://community.intersystems.com/post/how-use-and-set-its-value