on 10-27-2005 6:12 PM
Hi,
I am new to WebDynpro. My problem is very simple. I have two input fields. When i enter text in one input field i want the second input field to be disabled & Vice versa. The idea is that i want to give the user the option to enter text in only 1 input field of his choice. When, he chooses one field, the second input field should automatically get disabled. He can choose only one input field of his choice. The second one should get disabled.
Eg: Assume that there are two input fields "Item No" & "Material". The user should be able to do a search using any one of these parameters, but not both. So, when he chooses to do a search based on "Item No", the "Material" input field should be disabled (greyed out)once he enters text in the "Item No" field. And, vice versa. The choice of field is up to the user.
I guess it is a very elementary doubt. I went through many discussions, but since i am new to WebDynpro, I could not find a 100% satisfactory answer. Would appreciate if some explained the steps right from the beginning, instead of redirecting me to some other discussion. (Please include code as well, if any).
Kindly help.
This is not possible because there is no "onFocus" event on the input field.
But you could use two radio buttons R1, R2 to enable exactly one of the input fields F1, F2 at a time.
In the view designer, set R1.keyToSelect = "1", R2.keyToSelect = "2".
Bind R1.selectedKey and R2.selectedKey to a common context attribute A (type string).
If (at runtime) A contains "1", radio button R1 is selected, if A contains "2", radio button R2 is selected.
To enable input field F1 exactly if R1 is selected:
Create a calculated boolean attribute E1 that returns the boolean value ("1".equals(A)), bind property F1.enabled to E1. Do the same for F2.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys... It worked fine...
Thanks a tonne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I would suggest using the radio buttons just to denote the type of data the user is entering and having only one input field. Then use the date from the input field based on the radio button type the user selected.
Cindy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.