cancel
Showing results for 
Search instead for 
Did you mean: 

RadioButtons and Check Boxes

Former Member
0 Kudos

Hi Friends

i need to create Context for Radio buttons and Check boxes Application

so any one tell me the proces of creating this two ui elements n how to get the data from context

Regards

Narayana

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If u want to create check box at runtime, use <b>Checkbox group</b>.

For it's context variable, create a node(Say CheckBox) of cardinality 0..N

with a context variable(Say CheckValue) of type String. Bind this attribute(CheckValue) to <b>"texts"</b> property of CheckBoxGroup.

Now, to add 5 checkboxes from code, use the following code

IPrivate<View>.ICheckBoxNode lNode=wdContext.nodeCheckBox();

IPrivate<View>.ICheckBoxElement lEl;

for(int i=0;i<5;i++)

{

lEl=lNode.createCheckBoxElement();

lNode.addElement(lEl);

lEl.setCheckValue("Text"(i1));

}

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi,

For Radiobutton, use RadioButtonGroupByKey. For this, create a context variable(Radio) of type String and bind with selected key property.

To add values to this radio, use this code to add 5 radio buttons with text Radio1 ... Radio5.

IWDAttributeInfo att1=wdContext..getNodeInfo().getAttribute(IPrivate<ViewName>.IContextElement.RADIO);

ISimpleTypeModifiable ss1=att1.getModifiableSimpleType();

IModifiableSimpleValueSet sss1=ss1.getSVServices().getModifiableSimpleValueSet();

for(int i=0;i<5;i++)

{

sss1.put("Key"(i1),"Radio"(i1));

}

When u gets the value from radio button's context variable, u will get it's corresponding key.

For CheckBox, u can use CheckBox.Create a context attribute of type boolean and bind to Checked Property.

Regards

Fahad Hamsa

Former Member
0 Kudos

go through dis link