on 01-12-2007 1:31 PM
Hi
I want to add the field Id as a parameter into the action. He does this, but always the last fieldid and not the one which is used
//@@begin wdDoModifyView
if (firstTime)
{
IWDTransparentContainer rootElement = (IWDTransparentContainer) view.getElement("ButtonTransparentContainer");
for(int i = 0; i < wdContext.nodeYtf_Buttons().size(); i++)
{
wdContext.nodeYtf_Buttons().moveTo(i);
IWDButton button = (IWDButton) view.createElement(IWDButton.class, wdContext.currentYtf_ButtonsElement().getFieldid());
button.setText(wdContext.currentYtf_ButtonsElement().getName());
button.setTooltip(wdContext.currentYtf_ButtonsElement().getTooltip());
button.setWidth("250");
IWDAction action = view.getAction("SetButtonAction");
button.mappingOfOnAction().addParameter(wdContext.currentYtf_ButtonsElement().getFieldid(),0);
button.setOnAction(action);
rootElement.addChild(button);
}
}
}
You probably want
String fieldID = wdContext.currentYtf_ButtonsElement().getFieldid();
button.mappingOfOnAction().addParameter("fieldID", fieldID);
This will add to each button's event parameter mapping a parameter "fieldID" and you can use that value to decide which button triggered the action.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.