on 06-07-2008 10:32 AM
Hi,
I'm creating link to action UI dynamically, based on number of records i'm getting from R/3. I have mapped all the links to the same actions. now wen i click on the link i want to get the details related to that link and pass on through that action.
since my clicking on each link it should direct to different page and the data also varies..
How to solve this? help me out with sample code..
Thanks
Suresh
Use event parameter mapping to identify which link has triggered the common action.
Example:
Action "LinkClicked", parameter "linkID" : string
wdDoModifyView(...)
{
...
for (int i = 0; i < n; i++)
{
IWDLinkToAction link = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, "Link" + i);
link.setOnAction(wdThis.wdGetLinkClickedAction());
link.mappingOfOnAction().setString("linkID", link.getId()); /* use addParameter() in earlier releases */
link.setText("Link #" + i);
container.addChild(link);
}
}
Action handler:
void onLinkClicked(..., String linkID)
{
wdComponentAPI.getMessageManager().reportSuccess("Action triggered by link with ID " + linkID);
}
Of course you can add any parameter you want, not only one that contains the link ID.
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 |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.