cancel
Showing results for 
Search instead for 
Did you mean: 

Grouping radio buttons in table

Former Member
0 Kudos

Hi

I have a table with many lines and a radio button on each line.

I want to group the radio buttons according to a contract id from each line.

How do I implement a radio button group by key?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

something about radio button:

Every unique value of IWDRadioButton defined by KeyToSelect property. So bind IWDRadioButton.keyToSelect to attribute <context aattribute1> for one radio button and <context attribute2> for other radio button. here you can set the values of them.

SelectedKey attribute must be shared across all radio buttons that form logical "radio button group". In your context design every radio button has unique SelectedKey, so you have one group with only one button. So create on attribute which is assigned then to both the radio buttons SelectedKey property to hold them together in one group.

see this solved post for the same:

hope it helps

let me know if you face any problem

regards

reward points if it helps

Message was edited by:

Abhijeet

Former Member
0 Kudos

Abhijeet,

Sure it's possible to use same answer twice if the problem is the same or very similar. However, direct copy-paste is not always applicable.

<i>So bind IWDRadioButton.keyToSelect to attribute Addr_partner...</i> -- hmm... Anton mentioned context structure?

<i> In your context design every radio button has unique SelectedKey, so you have one group with only one button</i> --- author has no radio buttons at all... yet...

VS

abhijeet_mukkawar
Active Contributor
0 Kudos

Valery,

I have also posted both the the threads , and let me make one thing clear that the answer i copied from my post, also i attached both the posts (yours as well as mine if skipped something in hurry) for his reference. And to be precise , every answer or post gotta be descendant of one or more posts of your, you are so adept that there is hardly any thread which skipped your reply. So dude every post is generalised from yours, after all you are The One for WDJ. I sincerely bow you. Keep it up buddy

regards,

Former Member
0 Kudos

I think I understand what you are saying, but just to clarify:

If my table has 10 rows and each row has a contractID and each row has a radiobutton; if the 1st 5 rows have a contractID = 101 and the next 5 rows have a contractID = 102, then if I set keyToSelect = contractID for radio button property, the 1st 5 rows' radio buttons will be grouped and the next 5 rows' radio buttons will be grouped?

thanks

Anton Kruse

abhijeet_mukkawar
Active Contributor
0 Kudos

Anton,

KeyToSelect, should be the attribute bound to ContractID, which i hope is a context attribute in node which has 10 rows, here though first 5 rows has same value they wont be grouped , grouping is done by Selectedkey.

take another attribute out of the node structure, which may be a direct descendant of root context , and bind this to SelectedKey of radioButtons, so that all radiobuttons having this attribute as SelectedKey will be grouped,

refer the thread : it will clear your confusion if you have

regards

Former Member
0 Kudos

Ooooooh

I Understand now.

thanks a mil!

Former Member
0 Kudos

Anton,

If you understand, then the following picture should be clear to you:

You will have 10 rows hence 10 radio buttons. They all forms one group. First 5 radiobuttons correspond to one ContractID, second 5 to other. If you click any radio button in first group, then 5 radio buttons get mutually selected, and 5 radio buttons from other group get unselected. Similar if you click radio button from second group.

Abhijeet suggestion will work this way.

Is it right?

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Understood.

I would however use contractID bound to selectedKey so that the first 5 rows form a group and the 2nd five rows form a group. I would bind an different variable to keyToSelect.

Former Member
0 Kudos

Anton,

This way you get as many goups as there are number of rows.

The sad truth is that it's impossible to create 2 groups (or, strictly speaking, more then one group) using RadioButtonByKey as cell editor.

In fact you need to use ContractID only as group designator, some other attribute (from same node) should be used as KeyToSelect and there are should be as many attributes for SelectedKey outside table node as a number of unique contracts. However, for table cell editor it's just impossible to define specific per-row bindings.

VS

Former Member
0 Kudos

thanks. Once my RFC is working, I'll test and see what I get.

I'll let you know what my findings are.

Former Member
0 Kudos

Hi Valery

pls could you explain to me why the SelectedKey bound attribute needs to be outside the node.

In my example, contractID stays the same for the first 5 rows. What is the practical difference between having contractID inside the node or outside the node?

Former Member
0 Kudos

Anton,

Please tell first what you need to select with Radio Button. What is the result? contarctID placed into some attr? or other attribute selection?

Former Member
0 Kudos

Radiobutton will return a value 1-5 which is stored in context Questionaire.zValue. All I need back is a value 1, 2, 3, 4 or 5. Questionaire.contractID is only used to group the rows' radio buttons.

Former Member
0 Kudos

Anton,

See, you need to select one of Questionaire.zValue and place it to some other element attribute. This element must be "singleton" per group, i.e. every group must have own unique element to store selected value. SelectedKey shoud therefor point to such element and not to table node element while there are many of them, one per row.

VS

Answers (0)