on 09-13-2007 7:49 AM
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
Static because the flag variable is to be referenced in wdDoModifyView()
Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
As mentioned above, the UI elements can be created only in the wdDoModifyView.
But what you can do is to disable them first and on Action method set a flag variable as TRUE,
The UI Elements can be enabled for the true values of this flag variable. Also the flag variable should be a static variable.
Thanks and Regards
Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vila,
Are you trying to create UI elements dynamically in the action? If yes then you won't be able to do so because you can only create UI elements dynamically in WDDoModifyView().
Always WDDoModifyView() would be called after your action. So, you can handle it as you want in your WDDoModifyView() itself.
But if you want that those elements should be created everytime when you fire an event then don't write it within if(firstTime) clause as this would be true only when WDDoModifyView() is called for the first time when the page intially loads.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.