on 09-12-2007 10:51 AM
hi all,
I have created two radio buttons rb1, rb2 dynamically. If i click on rb1, ......
one label, one inputfield (ie., some UI elements ) must be displayed in the same view & if i click on rb2, other UI elements must display.
can anyone tell how to display UI elements which were created dynamically on the click of a radio button.
thanks & regards,
vila
Hi,
1. Create a context attribute name visible1 of type type com.sap.ide.webdynpro.uielementdefinitions.Visibility(using brose button in the type property of context)
2. Bind this context to all tha elements of that you want to make visible when radio button 1 is clicked to their visibility property.
3. Create a context attribute name visible2 of type com.sap.ide.webdynpro.uielementdefinitions.Visibility(using brose button in the type property of context)
4. Bind this context to all tha elements of that you want to make visible when radio button 2 is clicked to their visibility property.
5. Create actions for both radio button1 say action1 and for radio button2 say action2.
6. In action1 write this line of code
wdContext.currentContextElement.setVisible1(WDVisibility.VISIBLE);
wdContext.currentContextElement.setVisible2(WDVisibility.BLANK);
7. In action2 write this line of code
wdContext.currentContextElement.setVisible2(WDVisibility.VISIBLE);
wdContext.currentContextElement.setVisible1(WDVisibility.BLANK);
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vila,
You can create an action dynamically in WDDoModifyView but i can't understand where will you mention the code of your action.
So I am illustrating the way you can bind any action to your radiobutton at runtime.
Assume you have two actions action1 and action2
In WDDoModifyView()
// creating a radio button dynamically.
IWDRadioButton rad = (IWDRadioButton)view.createElement
(IWDRadioButton.class,"Radio1");
// Getting an instance of a radio button being defined at desing time names Radio1
IWDRadioButton rad1 = (IWDRadioButton)view.getElement("Radio1");
rad.setOnSelect("Action1");//to bind action1
rad.setOnSelect("Action2");//to bind action2
Regards,
Murtuza
Hi Murtuza,
Instead of creating action1 for rb1 & action2 for rb2 at designtime, can we create action1 for radiobutton1 & action2 for radiobutton2 at runtime?
i created two radio buttons rb1, rb2. now i want to create action1 for rb1 & action2 for rb2 at runtime.
after creating action for rb1, if i click on rb1, it must display some UI elements which were created dynamically & if i click on rb2, it must display some UI elements dynamically. ps suggest me how to do this?
Hi Vila,
You can create actions like this dynamically
IWDAction act = (IWDAction)view.createElement(IWDAction.class,"Action1");
but where to write the code for this action, i am not aware of this.
he above line will create an action for you at runtime.
I showed you how to set the action to radio button in the previous reply, you can follow the same.
Regards,
Murtuza
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.