on 07-05-2009 8:08 AM
Hi All,
I have a context node "header" and it has two context attributes "att1" , "att2"
att1 is of type string
att2 is mapped to a simple dictionary (having hardcoded values for the drop down)
In the view i have 2 dropdown
dropdown1 with values "A" , "B"
My requirement is when i chose "A" from the 1st drop down
The second drop down should be mapped to att1
if i chose B from the 1st drop down
The second drop down should be mapped to att2
Thanks
Suresh
Hi Suresh,
Please use this code:
// I am assuming that the value of the first dropdown is stored in context attribute "DropDownValue" which is directly under context node.
// Please use appropriate attribute name if it differs.
String value = wdContext.currentContextElement().getDropDownValue();
IWDDropDownByKey DDK = (IWDDropDownByKey)view.getElement("DROP_DOWN_ID");
if(value.equalsIgnoreCase("A")){
IWDAttributeInfo attrinfo = wdContext.nodeHeader().getNodeInfo().getAttribute("Attr1");
DDK.bindSelectedKey(attrinfo);
}
else if(value.equalsIgnoreCase("B")){
IWDAttributeInfo attrinfo = wdContext.nodeHeader().getNodeInfo().getAttribute("Attr2");
DDK.bindSelectedKey(attrinfo);
}
I hope this solves the issue. Please revert back in case you need any further information on this.
Thanks and Regards,
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.. it works
Regards
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi suresh,,
This code should be written in wdDoModify method in View controller
String value = wdContext.currentContextElement().getDropDownValue();
IWDDropDownByKey DDK = (IWDDropDownByKey)view.getElement("DROP_DOWN_ID1");
IWDDropDownByKey DDK1 = (IWDDropDownByKey)view.getElement("DROP_DOWN_ID2");
if(value.equalsIgnoreCase("A")){
IWDAttributeInfo attrinfo = wdContext.nodeHeader().getNodeInfo().getAttribute("Attr1");
DDK1.bindSelectedKey(attrinfo);
}
else if(value.equalsIgnoreCase("B")){
IWDAttributeInfo attrinfo = wdContext.nodeHeader().getNodeInfo().getAttribute("Attr2");
DDK.bindSelectedKey(attrinfo);
}
Thanks
Jati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.