on 05-28-2008 12:08 PM
Hi Friends,
I am writing an WDJ and WDA appliction where I have a need to select a specific row in IWDTable dynamically i.e. a method runs at runtime at gives me the index of the Row to be selected e.g the 3 row of the Table. I put that index in the Context in an Attribut. The Data in the Table is coming per RFC.
Any ideas may be how can I achieve that?
Best Wishes,
Farhan
Hi Ayyapparaj,
When i execute the Bapi i get 250 records which are automatically filled in the IWDTable through context mapping. But later when the Table is already filled then i want to select the 3rd Row.
farhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx Ayyaparaj Problem Solved.
Gr8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanx for the quick response. I was trying out your suggestions but I am getting following exception.
java.lang.IndexOutOfBoundsException: Node(VarTestingComp/VarTestingComp.Z_Fash_Getguvs_Input.Output, class=com.vartestingcomp.wdp.IPublicVarTestingComp$IOutputNode): index out of bounds: index=3, size=1
On seeing the exception I have changed the Collection and Selection Cardinality of the Context to 0..n both.
Here is the Code-Snippet
//parameter 1
int konfidenzlevel = wdContext.currentVaR_ParamElement().getKonfidenz();
//parameter 2
int records = wdContext.currentVaR_ParamElement().getStichprobe();
// returns the Index most of the time remains 3: 3rd row in Table
int VaRindex = (int)java.lang.Math.floor((1-(konfidenzlevel*1.0/100))*records) + 1;
// Now should the VaRindex-th Row should be selected.
wdContext.nodeOutput().setLeadSelection(VaRindex);
thx for the consideration.
farhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use
//Accessing the attribute that contains the index
int x = wdContext.currentContextElement().getIndexToSelect();
//assign this index to get the lead selection
wdContext.node<YourNode>().setLeadSelection(x);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the 3 row has to be selected in the table, just set the lead selection.
if the context node mapped to table id : tableDate
your code will look some thing like
wdContext.nodeTableData().setLeadSelection(3);
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In order to get the current row u need to perform getleadSelection on ur node which is bound to that table.
like
wdContext.nodeRFCNODE().getLeadSelection();
It starts from 0 like if ur first row is selected it will return 0;
Regards
Surender Dahiya
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.