on 07-16-2011 4:40 PM
Hello,
I am developing a interactive form (visitor info form) with webdynpro ABAP.
In the initial screen of my_webdynpro, there are couple of radio buttons, US, Europe, Asia.
If user selects US radio button: I have to greyout & readOnly the below 4 input text fields (pls. note these input fields are SCATTERED all around the FORM at different positions, subforms, pages, corners)
VISITOR.Page_1.Subform_1.TextField_4.fillColor = "192,192,192"
VISITOR.Page_1.Subform_6.TextField_17.fillColor = "192,192,192"
VISITOR.Page_4.Subform_13.TextField_24.fillColor = "192,192,192"
VISITOR.Page_5.Subform_21.TextField_31.fillColor = "192,192,192"
If user selects Europe radio button: I have to greyout & readOnly the below 3 input text fields
VISITOR.Page_2.Subform_23.TextField_21.fillColor = "192,192,192"
VISITOR.Page_4.Subform_35.TextField_37.fillColor = "192,192,192"
VISITOR.Page_5.Subform_39.TextField_41.fillColor = "192,192,192"
I can achive my requirement, by writing the below code at input text field LEVEL
if (this.rawValue == "US")
then
VISITOR.Page_1.Subform_1.TextField_4.fillColor = "192,192,192"
endif
As its tediuos, code redennecy, I want to do all US stuff (greying out all 4 fields) IN ONE SHOT, pls let me know is there any option for me, i guess GROUPing will not work for me?
Thank you
Hi,
First of all, instead of greying out the fields, you could make them Read Only in this way..
TextField1.access = "readOnly";
To make them editable again, you could use
TextField1.access = "open";
As for your current problem, I think there is some amount of code that has to be repeated..
But I have small solution in mind. Maybe it would be useful.
1) Create 3 hidden text fields - one each for the radio button value.. (US, Europe, Asia etc)
2) As soon as the radio button is selected, set the corresponding hidden text field to readOnly or open accordingly..
3) In each of the text fields's 'Calculate' event , write the following script.
this.access = Hiddenfield_US.access;
Regards, Amith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From what I know thus far, you will not be able to set the fields at one shot unless they are wrapped into a single sub form.
That way , you could set the single sub form itself as read only, thus rendering the underlying fields as read only.
As for my approach, it may not entirely avoid CODE REDUNDANCY (because of the repetitive code in each field's calculate event), but it would certainly reduce the number of lines of code.
Regards, Amith
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.