on 2005 May 03 1:46 PM
Hi,
I created un table that get results from a BAPI.
Everything works fine.
Now, I am trying to get the line where the user would click on and extract the data of this line.
How do I create a listener and how to get the data, the index of the line selected.... ?
Thanks a lot!
Hi David,
1. Create an action (AN_RowSelect)
2. Assign the action to the "onLeadSelect" property of the table.
3. Create an action handler (onActionRowSelect)
4. In the action handler implement the following code.
int nSelectedRow = wdContext.nodeVnResultTable().getLeadSelection();
IPrivateMyViewView.IVnResultTableElement nodeEltVnResultTable = wdContext.nodeVnResultTable().getVnResultTableElementAt(nSelectedRow);
Once you get the selected row element, you can access the column values by
String col1 = nodeEltVnResultTable.getCol1Value();
String col2 = nodeEltVnResultTable.getCol2Value();
Hope this solves your problem.
Regards,
Santhosh.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David
The following code deals deleting a row similar lines we can select add the row
onActionDeleteProduct()
//@@begin onActionDeleteProduct(ServerEvent)
int n = wdContext.nodeProducts().size();
int leadSelected = wdContext.nodeProducts().getLeadSelection();
// loop backwards to avoid index troubles
for (int i = n - 1; i >= 0; --i)
{
if (wdContext.nodeProducts().isMultiSelected(i) ||
leadSelected == i)
{
wdContext.nodeProducts().removeElement(wdContext.nodeProducts().
getElementAt(i));
}
}
//@@end
To avoid problems with the index, the context is here executed in reverse. All
elements selected in the table are deleted.
Hope this helped you
Regards,
RK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can access selected element through getLeadSelection of table data source in onLeadSelect (table event) event handler.
Regards, Maxim R.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
1. Create Action (see coresponding tab of View Controller editor) -- the process is straighforward, no parameters are necessary.
2. Assign action created to Table UI <b>OnLeadSelect</b> property.
3. In generated action handler for this Action you may use wdContext.node<YourTableNode>().current<YourTableNode>Element to get/set properties of record selected.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can get the selected row information from the context as below.
wdContext.current<Node>Element().get<<Attribute1>>
wdContext.current<Node>Element().get<<Attribute2>>
etc
Create an action and bind the action to the OnClick event of the Table and you can write the above statements in the action.
Regards, VIP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.