on 08-28-2007 10:53 AM
Hi EP Guys,
I am using the follwing method to create a dropdown, please tell me how to default particualr value of several options in the dropdown.
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("values");
IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
values.put("account number 1","account name 1");
values.put("account number 2","account name 2");
in the above example i would like to ser account name 2 as my default value for the drop down.
Pls Help.
Thanks,
=======
Srinivas M.
Hi Srinivas,
Try this... 100% helps. I tried your issue with DropdownByKey and DropDownByIndex. For DropDownByKey my earlier solution works.
But as you are using DropDownByIndex this should work!!!
Create a value node "vnSample" and a value attribute "vaSampleatt" under that node. In the property of the node set the cardinality of value node to 1..n and Selection to 1..1
Bind that attribute to your DropdownbyIndex.
Now in the implementation give the code below.
IPrivateSampleView.IVnSampleElement ele=wdContext.nodeVnSample().createVnSampleElement();
ele.setVaSampleAtt("Select Option 1");
wdContext.nodeVnSample().addElement(ele);
IPrivateSampleView.IVnSampleElement ele1=wdContext.nodeVnSample().createVnSampleElement();
ele1.setVaSampleAtt("Select Option 2");
wdContext.nodeVnSample().addElement(ele1);
//Loop for the number of values in the model node and create elements for the value node "vnSample" and set values to "vaSampleAtt".
After setting the values set the leadselection of the 0.
wdContext.nodeVnSample().setLeadSelection(1);
Hope this helps.
Regards,
Rekha Malavathu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
Actullay i have seens SAP help ealier but it has taken Node Attribute and and Value attibute inside it.. but i has only attributw which is of type (Dictionary Simple Type) may be this method doesn't support the leadselection option.. as it has no Node at all\.
So now i am chaging the code as given SAP Help.
Thnks for your replies..
Srinivas...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
DDIndex Example
http://help.sap.com/saphelp_nw04/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/frameset.htm
DDKey Example
http://help.sap.com/saphelp_nw04/helpdata/en/74/450e8af57065468e88e4b86de47e4b/frameset.htm
Go thru this links you can find your information what u require.
do you have any more problems post your issues.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Please let me know if its dropdownByKey or dropdownbyIndex.
Regards,
Rekha Malavathu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks for tour replies..
<b>Rekha:</b> I tried the solution u suggested infact it's clearing all the set values and in the dropdown it shows only one value, i.e. which we set in the last..
i.e. wdContext.currentContextElement().setValues("account number 2");
<b>Kanwalpreet & Prabakar :</b>
Surpisingly i am not getting the method "setLeadselection" is not there under "wdContext.currentContextElement()"
wdContext.currentContextElement().setLeadSelection(2);
i tried to hard code and facing error that "The method is not defined"
Any other alternative?
Thanks,
Srinivas M...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
When you say currentElement(), you are pointing to the leadselected element. There you cannot set lead selection. you can set leadselection only to a node, it may be context node, or any other.
such as,
wdContext.setLeadSelection(1);
wdContext.nodePerson().setLeadSelection(1);
Note:
-> LeadSelection is like a pointer. It points to only one element of a node at run time.
-> The index of the elements of any node starts from '0'.
-> If you dont want any element to be lead selected, set the LeadSelection to '-1'.
Prabhakar.
Hi Srinivas,
Try this code.
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("values");
IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
values.put("account number 1","account name 1");
values.put("account number 2","account name 2");
wdContext.currentContextElement().setValues("account number 2");
Regards,
Rekha Malavathu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.