on 06-18-2007 5:14 AM
how do i set the default of DropDownByKey
for instance i have several item in DropDownByKey
[Purchase List ]
- shoes
- blouser
- shirt
- jeans
if i want to set my shirt as default ..how to do this..
Hi ,
The UI element dropdownbykey , you might have binded the context attribute which was in turn mapped to the simple type. To select a default value you could set the attribute value as well to the one which you want as default.
In default case it picks the value which has key value 0 ( generated automatically at design time )
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
wdContext.currentContextElement().setPurchase List("shirt");
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yea, as Armin said, the first thing one needs to do for any query is to check the Java Docs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not just reading Javadoc?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi yzme,
There are 2 ways of doing that:
1.Attribute that you've binded to DDKey UI element.Stores the key of the rendered value at runtime.So set it to the default key (say Key 0 ) in your case.
2.In the wdModifyView you can get the DDByKey element and it has a method
as setSelectedkey("Default key");
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can set the default value of the DDBK if you know the key value of the attribute that is displayed.
Assuming "PurchaseList" as the attribute that is mapped to selecteKey property of the drop down by key.
wdContext.currentNodeDDBK.setPurchaseList(<your key for shirt>);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1)Create simple type and click Enumeration tab,then click New
2)Enter the Shirt as your first element,then it will set as default key 0
3)Create an attribute as SELECT and bind this attribute with simple type
4)Insert Dropdownbykey UI element,bind this with SELECT attribute
5)While runtime,shirt will set as first element....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yzme,
I understand that you created SimpleTypeDictonary for your DropDownValues and your context attribute is binded with above SimpleTypeDictonary. And your DD UI element is mapped with context attribute.
In the view of init or outboundplug method.
wdContext.currentContextElement()set<<b>ContextAttributeName</b>>("<b>SimpleTypeDictonary Value</b>");
B for blouser
Default Value
Exp :wdContext.currentContextElement()setPurhaseDD("B");
Rgds
SS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi yzme,
U have to get the key for the value shirt & set it as selected key in wdDoInit.
dropdownName.setSelectedKey(<key>);
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use setLeadSelection() method on your node which you have bind to your DropDown. For Example
wdContext.nodeAirlineValue().setLeadSelection( int element no);
Thanks and Regards
Avijit
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 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.