cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding radiobuttongroup ny key

Former Member
0 Kudos

Hi Experts

I created a dictionary simpletype "People" with two values male and female.

and i created a value attribute "people" and bind this attr to the prop of selected key of ui element.

iam able to see the radiobuttons in design time but iam not able to see at runtime.

Plz provide me solution

Thanks & Regards

Hazrath.G

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You have to bind the values to the UI Element Externally from SimpleType..incase

of RadioButtonGroup

Put the value attribute <Value> of Type String as child of a ValueNode, Say <TestNode>

and Take another Value attribute as child of conetxtNode <attr> of Type <SimpleType>

Then Use this code

IWDAttributeInfo objAttrInfo=wdContext.getNodeInfo().getAttribute(IPrivate<Viewname>.IContextElement.ATTR);

ISimpleTypeModifiable simple=objAttrInfo.getModifiableSimpleType();

Map m=simple.getEnumerationTexts();

Collection c=m.values();

Iterator it=c.iterator(); ArrayList al=new ArrayList();

while(it.hasNext())

{

IPrivate<ViewName>.I<TestNodeElement> element=wdContext.create<TestNodeElement>();

element.set<Value>(it.next().toString);

al.add(element);

}

wdConetxt.node<TestNode>().bind(al);

Hope this solves

Ragards

LakshmiNarayana

Former Member
0 Kudos

Lakshmi ,Thanks for ur immediate reply.

I have solved the above problem,i have done mistake like below

I have not changed the default datatype of value attributre type string.

I have one more question:

I want to select one option defaultly.

Plz give me the solution

Thanks & Regards

Hazrath.G

Former Member
0 Kudos

hi,

For this, you can set the attribute to which the radiobutton's selectedKey property is mapped to the key value in wdDoInit().

For Ex:

for male:

wdContext.currentContextElement.setRadioButton("MALE_KEY");

Here MALE_KEY is the key in the simple type for male.

thanks & regards,

Manoj

Former Member
0 Kudos

Manoj

If a write like ur inst's

wdcontext.currentcontextelement.setRadioButton("M_KEY");

It will not give tghe o/p.

Former Member
0 Kudos

hi,

If you are using RadioButtonGroupByKey then it will surely work.

And by the key i mean to say the value in the enumeration tab of your simpleType.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi manoj

If i write wdcontext.currentContextElement(0.setRadioButton("Male_KEY")

It will give the error:the method is undefined for current view

Former Member
0 Kudos

Hi,

Since the attribute you have used is called "people", you can try

wdContext.currentContextElement().setPeople(<here put in the key for the value "male">);

Regards,

Satyajit.

Former Member
0 Kudos

Thanks a lot chakri

I have solved the problem.I have given 10 points to u.

Thanks & Regards

Hazrath.G

Answers (0)