Skip to Content
0
Former Member
Sep 10, 2007 at 05:36 AM

dynamicdropdownbykeyproblem

17 Views

Hi,

i hav created a dropdownbykey dynamically with 2 elements "product1" & "product2"..ive created the context and attributes dynamically as well...

in wddoinit i hav the foll code:

public void wdDoInit()

{

//creating node

IWDNodeInfo array=wdContext.getNodeInfo().addChild("array",null,true,true,false,false,false,true,null,null,null);

//creating attribute

IWDAttributeInfo info=array.addAttribute("product","ddic:com.sap.dictionary.string");

ISimpleTypeModifiable mytype=info.getModifiableSimpleType();

IModifiableSimpleValueSet val= mytype.getSVServices().getModifiableSimpleValueSet();

val.put("P1","Product1");

val.put("P2","Product2");

//@@end

}

and in wddomodify i hav the foll code:

public static void wdDoModifyView(IPrivateView1 wdThis, IPrivateView1.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

IWDTransparentContainer tc=(IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"transparent container");

IWDDropDownByKey dr=(IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,"drop down");

dr.bindSelectedKey("array.product");

dr.setWidth("60");

dr.setVisible(WDVisibility.VISIBLE);

tc.addChild(dr);

IWDTransparentContainer root=(IWDTransparentContainer)view.getElement("RootUIElementContainer");

root.addChild(tc);

//@@end

}

My question is i want to set "product1" as default..plz help..

wdcontext.currentcontextelement.set<attrib>("");.....this command is not helping.