on 04-16-2008 7:18 AM
Hi Experts,
I made a radiobuttonbykey in my application and have 4 options.
I want to disable and enable the options according to selection made on a dropdown.
For example
if i choose option 1 from dropdown then 2 options of radiobutton become enable and rest disable
if i choose option 2 from dropdown then 3 options of radiobutton become enable and rest disable
and like that...
I am able to disable/enable the whole radiobutton but i want its options to be disabled or enabled.
Regards
Rajat
Hi Rajat,
I understand your problem is that using radiobuttonbykey UI element, you can set the enabled property on/off for the entire value set, and not for individual values.
Is it ok to use radiobutton UI element for your requirement? Or is it that you are using some domain fixed values or value table as the value set for the radiobuttonbykey?
Depending on this, you can select one of the two alternatives:
1) If its ok to use radiobutton UI element, then there can be four different radiobutton UI elements bound to the same context. At runtime, the context will hold the key specified for the selected radiobutton. And here you can bind the visible/enabled property of the four diff radio buttons to a boolean context and can change it as per your requirement.
2) Incase you need to use radiobuttonbykey UI element, then bind the context dynamically through coding to the radiobuttonbykey. OnSelect event of the dropdown, you can define an action wherein you update the value set of the context bound to the radiobuttonbykey.
Incase of queries please revert.
Regards,
Chitrali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
declare an attribute enable_1 and enable_2 of type wdy_boolen in context node.Then for radiobuttondrpbykey set the enable property for this attribute.(ie for all radio buttons)
get the value of drop down using
CALL METHOD lo_element->get_attribute
IMPORTING
name= 'DRP'
EXPORTING
value = 'drp_val'.
if drp_val = '1'.
lo_el_context->set_attribute(
EXPORTING
name = `enable_1`
value = 'X' ).
else if drp_val = '2'.
lo_el_context->set_attribute(
EXPORTING
name = `enable_2`
value = 'X' ).
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajat,
Each Radio button UI element has the property called "Enabled".
So if u have four radio button menas create four attributes with type ABAP_Boolean and Bind it to your respective Radio button propert "Enabled".
Now If the attribute valie is "X" menas it is enabled and No value menas it will disabled at the browser.
Based on your conditions, using Set attribute method set the value "X" to your attribute and Enable/diable your Radio Button.
Any doubts let me know.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.