cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Buttons in a WD table

Former Member
0 Kudos

Hello there

Last week I posted a thread regarding implementing Radio buttons in my table and never got a solution.

So this is the problem please try to help, I have a table getting it's data from a backend system, now I add a column with a radio button as a cell editor, and connect the attributes KeyToSelect to and attribute with numbers which presents the row number and the SelectedKey to an attribute which holds the number selected, the thing is I am getting the radio buttons marked and disabled, which is not good

The radio buttons for now don't have to mean a thing except then to make it easier to the customer to pick a line in the table, So please try to help me

Thanks a lot, and happy Hanuka 2007 from Israel

Accepted Solutions (1)

Accepted Solutions (1)

former_member182374
Active Contributor
0 Kudos

Hi Oren,

Try this:

Say your RFC output is as follows.

Output (node)

---> I_Rfq (node, table from RFC)

-


> Ebeln (a row from the table).

Table:

Your table data source should be: <rfc name>.Output_I_Rfq

Your 'selection mode' should be none.

Radio Button column:

keyToSelect - <rfc name>.Output.I_Rfq_Ebeln

Create a string value in the context (let's call it: selectedRadioButtonKey)

selectedKey - selectedRadioButtonKey (from the context).

Happy Hanuka

Regards,

Omri

Former Member
0 Kudos

Hey thanks

What do you mean by Ebeln (a row from the table).???

former_member182374
Active Contributor
0 Kudos

Hi Oren,

'Ebeln' is just the field name in MY rfc, it could be anything else (depend on your RFC output...).

Regards,

Omri

Former Member
0 Kudos

Hi

well I guess this is it but still I get the radio buttons disabled and I cant pick them

Former Member
0 Kudos

Omri

Sorry but it doesnt help it is steel disabled

former_member182374
Active Contributor
0 Kudos

Hi Oren,

Try this:

1) Assume your RFC context looks like this:

Z_RFC_Name

--> Output

-


> Table_Name

-


> Table_Row

2) Add a value attribute called 'SelectedKey' to the context

3) Add a table UI element to the view

Table should have two columns:

A) column 1 - TextView

The 'text' propery should be bind to Z_RFC_Name.Output.Table_Name.Table_Row (from the context).

B) column 2 - Radio Button

The 'keyToSelect' property should be bind to Z_RFC_Name.Output.Table_Name.Table_Row (from the context).

The 'selectedKey' property should be bind to SelectedKey (from (2))

4) Add an action 'rowSelected' and bind it to the radio button 'onSelect' event

5) On 'rowSelected' implementation you can get the key selected by writing:

wdContext.currentContextElement().getSelectedKey();

(from (2))

Regards,

Omri

Former Member
0 Kudos

Thanks a lot It is very helpful and things are starting to move here

Let me know something else now that it is working what I still miss is that when I select a radio button it will pick the row as well, i tried to connect it tot the action "LeadSelect" but nothing is happening

any Ideas?

former_member182374
Active Contributor
0 Kudos

Hi Oren,

Lead select is the 'builtin' event for selecting a row (nothing to do with the radio button you added).

For the radiobutton, go to the radiobutton column and add action to the 'onSelect' event (see my previous answer)

Regards,

Omri

Former Member
0 Kudos

Hey Omri

Yes I know they are not related, but now when you have radio buttons in a table you would assume that they will be the selecting UI, now my question is how would I let the table understand that when selecting a radio I change the lead selection, and set the focus on some field in the table??? I got it working on "onLeadSelect" but when try to do the same in the radios it wont work

former_member182374
Active Contributor
0 Kudos

Hi Oren,

I still don't understand what's the problem.

Say your context looks like this:

Z_RFC_Name

--> Output

-


> Table_Name

-


> Field1

-


> Field2

-


> Field3

-


> Field4

In the event handler of the <b>radiobutton</b> you can write:

String field1 = wdContext.currentTable_NameElement().getField1();
String field2 = wdContext.currentTable_NameElement().getField2();

Current table element is current row...

Regards,

Omri

Former Member
0 Kudos

Hey Omri

First thanks for the paitiant,

The basic problem was implemanting the radio buttons but your answer was helpfull and I got it.

Now the problem is that when I pick a row it should set focus on one of the input fields, and it works fine in the leadselect or onEnter, but on the radio buttons it wont work, so I figurde I should setLeadSelection on the raw that was selected by the radio how would I do that??/

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Oren,

Based on your question ...

You can try these follwoing steps :-

1. Create a Context attribute for key selected ( which u have already done) in the contrioller.

2. In the context property use supply function ...this may solve ur purpose.

thanks

Pankaj

Former Member
0 Kudos

My recommendation is to use the table as designed and not simulate the single-selection by radion buttons. Just set the selection cardinality of the data source to 0:1 and use the predefined selection buttons in the first column.

Armin