on 10-20-2008 5:26 AM
Hi
I have a scenario in which i wld be creating button ui element dynamically i need to bind a separate action to each of these.
How do i do it.
The no of buttons created would be dependent on the node size.similarly the no of actions created would be dependent on the node size.
I would suggest to use a common action, created at design-time, for all of these buttons. Use event parameter mapping to determine which button was pressed to fire the action.
Example: Create an action "ButtonPressed" with a parameter "index" (int) that will contain the index of the context node element corresponding to the button.
The code that creates the buttons looks like this:
for (int i = 0; i < wdContext.node<YourNode>().size(); ++i)
{
IWDButton button = (IWDButton) view.createElement(IWDButton.class, null);
button.setOnAction(wdThis.wdGetButtonPressedAction());
button.mappingOfOnAction().setParameter("index", i);
/* etc... */
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can go thru the following link for dynammically adding a button :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi!
set the button enable property as true and then do the parameter mapping.this is necessary for client side events.
chk the following link for parameter mapping
http://help.sap.com/saphelp_nw04/Helpdata/EN/25/d41a403233dd5fe10000000a155106/content.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
follow this link
http://help.sap.com/erp2005_ehp_03/helpdata/EN/04/72a840bd6d3c13e10000000a155106/frameset.htm
once you create dynamic button, then you need to access that button thru button id. and once you get the id you can perform different action.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
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.