on 08-04-2006 6:36 AM
Hi,
I have few dropdowns (dropdownbyindex) in a table. I need to make default selection of an item in the dropdown.
for example if one of my dropdown has values "A","B","C","D". I want to show B as selected. How can we do this?
Any help?
regards,
Sujesh
Hi,
You must have bound the texts property of the dropdown to some context node. Just set the leadselection of that node.
For example, if your context looks like
-Root
--DataNode
---Text() (value attribute mapped to textx property.)
wdContext.nodeDataNode().setLeadSelection(1);
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Then do this:
int lead = 0;
for(int i = 0; i < wdContext.nodeDataNode().size; i++){
IWDNodeElement elem = wdContext.nodeDataNode().getElementAt(i);
if(elem.getAttributeAsText("Text").equalsIgnoreCase("D"))
{
lead = i;
break;
}
}
wdContext.nodeDataNode().setLeadSelection(lead);
Regards,
Satyajit.
Hi,
Try this,
when load the node values check the selected value in the adding list and set it as lead selected.
IPrivate<ViewName>.IReceiverNode nodeReceiver=wdContext.nodeReceiver();
for(int k=0;k<wdContext.nodeReceiver().size();k++) {
String curentvalue=String.valueOf(((IPrivate<ViewName>.IReceiverElement)(wdContext.nodeReceiver().getElementAt(k))).get<Param>());
if(curentvalue.equals("B")){
nodeReceiver.setLeadSelection(k);
}
}
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.