on 04-16-2008 2:09 PM
Hello Experts,
I've just created a Tab where Data can Edit.
It looks like a formular > see the following lines:
Activity_1---->DropdownMenu--->InputField---->RadioButton
Activity_2---->DropdownMenu--->InputField---->RadioButton
I've create a Context for the DropdownMenu filled with "Symple Types"
The DropDownByKey includes three things to choose (e.g. allowed, not allowed, no idea).
Before choosing one of them I want the InputField and the RadioButtons Disabled. When I choose allowed, I want the InputField and the RadioButton get Enable.
I hope for help.
Thanks a lot
Best regards
Create a boolean context attribute named for example "readOnly" and bind the equally named property of the input field and the radio button to this attribute. In wdDoInit(), set the attribute value to "true".
This will make the input field and the radio button read-only initially.
Assign an action to the DropDownByKey.onSelect event.
Assuming the "selectedKey" property of the DropDownByKey element is bound to a context attribute named "selectedKey", implement the action handler like
void on<ActionName>Action(...)
{
String selectedKey = wdContext.currentContextElement().getSelectedKey();
if ( "allowed".equals(selectedKey) )
wdContext.currentContextElement().setReadOnly(false);
}
Take care to compare the context attribute value to the key of the type enumeration, not to the descriptive text!
Armin
Edited by: Armin Reichert on Apr 17, 2008 10:12 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know, where I have to bind the inputfield and the radiobutton.
So far, I have one context with type (path to the Symple Type")
so the context includes the allowed, not allowed, no idea).
Should I create another seperate Context with type (boolean)?
I don't know, where and how I have to bind the inputfield and the radiobutton.
Thank you
hi ,
u can create a context Attribute in the view
eg:
Context Attribute be "input"
and type is Boolean. and bind the readonly property of the Inputfield and radio button to the Attribute "input".
in the Doinit method .
set the Attribute Value to be true.
wdContext.CurrentContextElement.setInput(true);
in the domodify method use the if condition as told by armin
and as per ur requirement make the property of the Attribute to false if the drop down by key , selected vale is allowed.
wdContext.current.setInput(false);
thanks and regards
fistae
Thank you,
I've have one more problem.
I did what you said, but there is the mistake when I take the code below "the method getSelectedKey() is undefined for the type IPrivat....IContextElement"
Assuming the "selectedKey" property of the DropDownByKey element is bound to a context attribute named "selectedKey", implement the action handler like
void on<ActionName>Action(...)
{
String selectedKey = wdContext.currentContextElement().getSelectedKey();
if ( "allowed".equals(selectedKey) )
wdContext.currentContextElement().setReadOnly(false);
}
What I have to do in the wdModify???
Thank you
Marcus
I have another question to my first problem. Because I have several activities, to such an input field and radio button item follows, I will make it so that for each activity, independent from th others, I can choose one of the three things (Allowed, ...). Do I have to create a context attribute for each activity? or how do I realize?
Later I will store it in a database and want to display the information in a next view.
Thanks for the help
Hi,
As mentioned by you,you have created a simple type to bind it to dropdown key.So for instance you created simple type with following enumeration:
Value Description
a. AL Allowed
b. NA Not Allowed
c. NI NoIdea
To fullfill your requirement,create a boolean context and bind it to your input field and radio button.
Now Go to your layout of dropdown by key and you will find a event on Select.Create a event for it and inside that event write the following piece of code..
In the Action OnActionSelectDropDown()
{
String selectedKey = wdContext.current<Node>Element().get<AttrBindedtoDD>;
if(selectedKey .equalsIgnorecase("AL"))
{
// Make the boolean context as true
}
else{
// Make the boolean context as false
}
}
Hope this will resolve your problem.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Regards,
Amit Bagati
Edited by: Amit Bagati on Apr 16, 2008 5:24 PM
Edited by: Armin Reichert on Apr 16, 2008 8:04 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
The dropdown by key contains 3 values at run time.Take one more context attr of type boolean and bind with the property readOnly of InputField and RadioButton.Assign an Action to the DropDownByKey.
In the Init method disable the InptField means setting the attr to either true or false.Which binded to readOnly property.
In the Action OnActionSelectDropDown()
{
String keySele = wdContext.current<Node>Element().get<AttrBindedtoDD>;
if(keySele.trim().equalsIgnorecase("Allowed"))
{
//enable or disable the inputfield
}
else{
//enable or disable the inputfield
}
}
Regards
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
Initialy make the input field and radio button to readonly .
if the user selects the dropdownBykey as "Allowed"
in the method u have to check for the possible selction.
let say the attribute name is drop in the context of the view
ie if(wdContext.currentNodeElement.getdrop().equals("allowed")){
set the readonly property to false for the radio button and inputfield.
}
hope ur problem get resolved
thankd and regards
fistae
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.