on 09-08-2005 8:08 AM
Hi,
I have a table that I am retrieving from the backend through an RFC. After I get this, I need to get details through another table. The problem is:
I have to retrieve different tables based on the selected items in a particular row.i.e If I have 3 coulumn attributes in a particular row of the table, on select of any 1 of these column attributes for a particular row I need to be able to retrieve 3 different tables.
I know to get a single table on select of a row, but here I need to select different tables through column elements of the same row(like links)!
How can I do this?
thanks
hi Sunil,
You can use linktoaction UI element as tablecell editor.
Create the table dynamically.
For each of the columns create linktoactionelements with diffferent ids
IWDLinkToAction linktoaction_dep = (IWDLinkToAction)view.createElement(IWDLinkToAction.class,"link"+i+";"+<attribute name>);
linktoaction_dep.bindText("<node name>." +<attribute name>);
Create an action and link the link to action UI element like this.Send the id as a parameter.
IWDAction onClickName = wdThis.wdGetAPI().getAction("onClickName");
linktoaction_dep.setOnAction(onClickName);
linktoaction_dep.mappingOfOnAction().addParameter("name",linktoaction_dep.getId());
column.setTableCellEditor(linktoaction_dep);
In the action write
[/code]
StringTokenizer st = new StringTokenizer(name,";");
String rem = st.nextToken();
String attribute name = st.nextToken();
[/code]
Once you get the attribute name in the action you can differenciate the clicked column
Hope this helps you
Please revert for details
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or simpler:
Create 3 table columns A,B,C <b>at designtime</b> in the view designer, use LinkToAction as cell editor.
Define an action "ColumnLinkActivated" with a parameter "column" : string, attach this action to each LinkToAction.onAction event.
In wdDoModifyView(), define a parameter mapping for each LinkToAction, that allows to identify the containing table column after a link has been activated:
if (firstTime)
{
IWDLinkToAction linkA = (IWDLinkToAction)
view.getElement("<ID of link in column A>");
linkA.mappingOfOnAction().addParameter("column", "A");
IWDLinkToAction linkB = (IWDLinkToAction)
view.getElement("<ID of link in column B>");
linkB.mappingOfOnAction().addParameter("column", "B");
IWDLinkToAction linkC = (IWDLinkToAction)
view.getElement("<ID of link in column C>");
linkC.mappingOfOnAction().addParameter("column", "C");
}
In the action handler implementation:
void onColumnLinkActivated(..., String column)
{
if ("A".equals(column))
{
link in column A has been activated
}
else if ("B".equals(column))
{
...
}
else
{
...
}
}
Armin
Sunil,
Why not to use LinkToAction cell editor then?
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.