on 01-19-2007 1:58 PM
Hi all!
I want to use one action for several buttons in a view. When I hit one, I want to get the id of the button from the event. I know that it's not in the standard, anyway I found a post by Maksim Rashchynski who proposed to use wdDoModifyView like this:
final String id = element.getId();
final IWDButton button = (IWDButton)element;
button.mappingOfOnAction().addParameter( "actionID", id );
sounds nice, but what is element? Where can I get it from?
anybody?
thanks
stefan
wdDoModifyView()
{
IWDButton button = (IWDButton) view.getElement("MyButton");
button.mappingOfOnAction().addParameter("buttonID", button.getId());
}
(in more recent IDE versions this can be done in the view designer without code)
Action "A" assigned to button: Add parameter "buttonID" of type string.
Action handler:
onActionA(..., String buttonID)
{
/* check button ID */
if ("MyButton".equals(buttonID))
{
}
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
wdDoModifyView()
{
IWDButton button = (IWDButton) view.getElement("MyButton");
button.mappingOfOnAction().addParameter("buttonID", button.getId());
}
is useless, as long as I don't know which id the button has, that is what I want to find out.
We use SP19 it had no effect to add the parameter to the action: buttonID is null.
Hello Armin
What did you mean by "in more recent IDE versions this can be done in the view designer without code"?
We have NWDS 7.0.0 (Developer Workpace 2004s, SP4).
Is that recent enough?
What can I do and where in the layout view properties of a button?
As far as I know there is no other way to add parameters to an event other than by the wdDoModifyView() method.
Regards
Kilian
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.