Skip to Content
0
Former Member
Sep 13, 2007 at 06:49 AM

how to create dynamic elements in action of a view?

24 Views

hi all,

I created 2 buttons dynamically in WdDoModifyView(). I created action1, and parameter for that action i.e, id of type string.

when i click on button1, some ui elements must be displayed.....

can anyone tell me how to dynamically add UI elements in onAction() of view.....

i wrote the following code to create & map dynamically in WdDoModifyView()........

if(firstTime)

{

IWDButton b1=(IWDButton)view.createElement(IWDButton.class,"button1");

b1.setText("Button1");

IWDButton b2=(IWDButton)view.createElement(IWDButton.class,"button2");

b2.setText("Button2");

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

tc.addChild(b1);

tc.addChild(b2);

IWDButton butt1 = (IWDButton)view.getElement("button1");

IWDParameterMapping pm1a = butt1.mappingOfOnAction();

pm1a.addParameter("id1","link1a");

IWDButton butt2 = (IWDButton)view.getElement("button2");

IWDParameterMapping pm1b = butt2.mappingOfOnAction();

pm1b.addParameter("id1","link1b");

}

after writing this..... in onAction().........of view... i wrote like this...

if (id1.equals("link1a"))

{

}

else{

}

in the if & else condition, i have to create UI elements dynamically.

when i am trying to create Ui elements dynamically, but i am unable to create dynamically here.

pls give me suggestion how to proceed this

regards,

vila