on 04-29-2008 1:00 PM
hi
I have created a dropdown menu(by Key).I have populated the values by binding the "texts" property to an attribute "num" that i have defined to be of simple type string.
How can I set the lead selection for this dropdown.
Plz Help
Hi,
I think u mean to say that have u binded selected key property to "num".
For lead select u can set this attribute with any of the value which you have defined in simple type.
for eg.
I have three values in simple type and suppose "dynpro" is one of the value which i want to be selected by default .
so before ur view is being u can set the "num" attribute with dynpro.
i.e
wdcontext.currentcontextelement.setnum("dynpro");
regards
Surender Dahiya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi......
well dynamically you can do it
public void wdDoInit()
{
//@@begin wdDoInit()
IPrivateViewDropkey1.IDropKeyElement ele = wdContext.createDropKeyElement();
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("DropKey.Key");
IModifiableSimpleValueSet val = myType.getSVServices().getModifiableSimpleValueSet();
val.put("1" ,"product1");
val.put("2" ,"product2");
//@@end
}
Now in the wdModifyView
public static void wdDoModifyView(IPrivateViewDropkey1 wdThis, IPrivateViewDropkey1.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(firstTime)
{
// creating tranparent container
IWDTransparentContainer tc = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"TransparentContainer");
// creating dropdownkey
IWDDropDownByKey key = (IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,"Dropkey");
key.bindSelectedKey("DropKey.Key");
key.setWidth("60");
key.setVisible(WDVisibility.VISIBLE);
//setting the selection to the first value
key.setSelectedKey("1");
tc.addChild(key);
IWDTransparentContainer root = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
root.addChild(tc);
//create an action called Click in the view
IWDAction action = wdThis.wdCreateAction(IPrivateViewDropkey1.WDActionEventHandler.CLICK, "");
key.setOnSelect(action);
}
//@@end
}
regards,
pinki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks Ayyapparaj
But please tell me how to populate a dropdown by index at design time(and not at run time).
I created a value node called "val" and created an attribute called num inside this value node. I bound this "num" to a simple type (of type string), In the enumeration of this simple type I have given the values I want to populate the dropdown with but the dropdown showed no values.
Plz help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You mix things up. DropDownByKey and DropDownByIndex have completely different data binding models.
You can create value sets at design-time using the dictionary type editor. These value sets then can be used by a DropDownByKey at runtime to provide its items.
For a DropDownByIndex you need a context node filled with elements which can only be done at runtime.
Armin
Hi,
Lead selection works only with Drop down by index as its bound to a node .
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi himanshu,
You can use the following methods to set the selection.
wdContext.node.setLeadSelection(-1).
Here (-1) indicates selection nothing.
rewards points if helpful
best regards
ep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.