cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Buttons in Table

Former Member
0 Kudos

Re: InputFields in a table

Posted: Aug 27, 2007 1:13 PM in response to: Juergen Kind Reply E-mail this post

Hi,

I have read the documentation, but not got any clue for my problem,

In my component I have 3 Radio buttons in 3 Columns of a Table, and the functionality is like , when I click the 1st Radio Button , the 3rd Radio Button will be set readonly, and when again click on 2nd radio button the 3rd one will be enabled.

I have written action in On-click of radio buttons, but it's not working properly, if I set the readonly property false for 3rd one for a particular row, 3rd Radiobutton in all other rows also getting set to read only.

Please help me in this regard.

Thanks,

Sonia.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

You need to use CELL_VARIANT fot his. Crete 2 cell variants for the column.

'Variant_Read_Only' for read only radio button

'Variant_Not_Read_Only' for the normal Readio Button

Both has the CELL_EDITOR as RadioButton. The 'Variant_Read_Only' Cell variant should have the RadioButton Cell Editor with read only property.

.

Bind the Cell_Variant property of the column to a context attribute . You have to fill this attribute with the NAME of the corresponding Cell variant...that is if you want Read only radio button, the name should be Variant_Read_Only and vice versa.

Thats It...

If u need more clarifications , do let know.....

Former Member
0 Kudos

Hi Sonia.

You need an attribute in your context node which defines wetrher the cell editor of the column is enabled or disabled per row. Bind this property to the enabled attribute of the radio button column. When the first radio button is selected set this

attribute in the current element to false so that the third radio button will get disabled.

Cheers,

Sascha

Former Member
0 Kudos

Please tell me how to set this attribute for the current element only

Thanks

Sonia

mohammed_anzys
Contributor
0 Kudos

Hi Sonia,

You need to get the element of the current row which you have selected.This can be done in the onSelect of the radio button, in that method , there is a parameter WDEVENT , where the selected context element of the row will be available.

CALL METHOD WDEVENT->GET_CONTEXT_ELEMENT

EXPORTING

NAME = 'CONTEXT_ELEMENT'

RECEIVING

VALUE = <YOURTABLETYPE>

.

This will fetch you the current row which you have selected , and from this you can update the radio button values and bind it back

Thanks

Anzy

Former Member
0 Kudos

Hi Sonia,

As Anand pointed out, you need to use cell variants. To enable/disable fields at cell level, this is the only method that I know of that works.

Regards,

Neha

Former Member
0 Kudos

Hi Neha.

You can use an attribute of the current element to set the cell editor enabled or not like Anzy explained. You could do it with Cell Variants, but just enabling or disabling cell editors can be done easily without using cell variants.

Cheers,

Sascha

Former Member
0 Kudos

Hi Anzy,

Your answer solved my problem partially, thanks a lot,

Please tell me one thing like, if I want to set the radio button as read only, by binding it's read only property with a WD_BOOLEAN Type Context Attribute, do I need to create that attribute with in this Table Context Node??

Actualy, initially I created one separate node, which have this WD_BOOLEAN Type Context Attribute and the read only property of radio button is bound to this attribute,

But when I am setting this as TRUE, it's making the whole column read only, not just for the selected row.

Thanks for your quick response.

Sonia.

Former Member
0 Kudos

Hi Sonia.

What you did is wrong, cause the extra node contains only one element i Guess and this element is used ans set by all cell editors of all rows of the other node.

So if you set this attribute to false, all cell editors are bound to it and will be disabled. You have to create the attribute in the node of the table so that each row has its on value and each cell editor will be bound to this attribute of its own element.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sonia,

You should not create an extra node. Add an additional attribute of type wdy_boolean in your existing context node that is bound to the table. Bind the enabled property of the 3rd column cell editor to this attribute.

In the action handler of the 1st radio button, set this attribute to false and in the 2nd event handler set it to true. In both cases, use the statement given by Any to get the current row in which the radio button was clicked and just do lr_element->set_attribute( ). That will solve the issue.

Regards

Nithya

Former Member
0 Kudos

Thanks Sascha,

Now I got the point, hope this will solve my problem.

Former Member
0 Kudos

Thanks Nithya, hope this will work

mohammed_anzys
Contributor
0 Kudos

Hi

It seems like , you are setting the property for the entire node , rather than setting the value for the perticular element.

Please paste your code..so that we can point out wheere the acvtual problem is ..

Thanks

Anzy

Former Member
0 Kudos

Hi Anzy,

I have created one context attributr, read_only which is WD_BOOLEAN,

Read Only Property of the Radio Button in the 3rd Column is bound to this context attribute,

And onclick of Radio Button in First Column, I am setting the read_only context as true,

I think it is getting set to true for the whole node, please tell me how to set it true, for that particular selected row element,

One more thing , I have written some more functionality on this OnClick action, but it is working fine with the selected row only,

If I select a RDB for a ROW which is not selected, this code is not working properly,

Thanks for your quick response.