on 02-13-2008 7:00 AM
hi,
I have created an application where, a dropdownkey is created dyncamically and then, the two values Product1 and product 2 are created...on selecting any one product it navigated to another view with the help of onSelect.....
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
}
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);
//// key.setSelectedKey("1");
tc.addChild(key);
IWDTransparentContainer root = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
root.addChild(tc);
IWDAction action = wdThis.wdCreateAction(IPrivateViewDropkey1.WDActionEventHandler.CLICK, "");
key.setOnSelect(action);
}
public void onActionClick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionClick(ServerEvent)
//// String attr = (string)wdContext.currentContextElement().getAttributeValue("attr");
String value = wdContext.currentDropKeyElement().getKey();
if(value.equals("1"))
{
wdThis.wdFirePlugToViewDropkey2();
}
else if(value.equals("2"))
{
wdThis.wdFirePlugToViewDropkey3();
}
//@@end
}
Is this a question or an example of how to do it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
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.