on 12-09-2011 11:33 AM
Hi All,
Can someone help me with the code to get the node selected value from a table and then set that values to input fields?
Early response would be much appreciated.
Thanks
Uday
the lead selection can not help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
I have written following code for lead selection. but in this case, i could get only able to fetch the values of only one column,
how can i change this code for 4 more columns.
ArrayList list = null;
if (wdContext.nodeOutputOvs().getLeadSelection() == 0) {
int j = wdContext.nodeOutputOvs().getLeadSelection();
list.add(wdContext.nodeOutputOvs().getElementAt(j));
}
for(int b=0; b<list.size(); b++) {
String Tprog = (String) list.get(b);
ovsCallerNodeElement.setDWS_Tporg(Tprog);
}
Please help me enable this code for 4more columns
Thanks
Uday
Dear Uday,
Please user the isMultiSelected inside the for loop and iterate through all the rows selected to set in the arraylist.
if(wdContext.node<Node Name>().size()>0)
{
// Iterate through the context Node
for(int i=0;i<wdContext.node<Node Name>().size();i++)
{
if(wdContext.node<Node Name>().isMultiSelected(i)) {
// Set the ArrayList here for the Lead Selected elements of the Table multiple selected rows
}else {
// Set the ArrayList here for the Lead Selected elements of the Table single selected rows
}
}
}
Best Regards
Arun Jaiswal
Edited by: Arun Jaiswal on Dec 10, 2011 2:04 PM
Thanks Arun,
your help link was very helpful.
but in my case i need to add 4 attribute values to Arraylist. So, i just wanted to ask, if its valid to keep adding each attribute to the list. i feel that only one attribute and its values could be added to the list. for eg.
list.add(wdContext.nodeOutputOvs().getElementAt(j).getTprog());
list.add(wdContext.nodeOutputOvs().getElementAt(j).getTtext());
list.add(wdContext.nodeOutputOvs().getElementAt(j).getsollz());
list.add(wdContext.nodeOutputOvs().getElementAt(j).getsobeg());
list.add(wdContext.nodeOutputOvs().getElementAt(j).getsoend());
please tell me if the above code is valid for list. in this case, i am inserting values of five attributes of a table to array list. if i execute this statement, i feel i would only be able to add the last row and first four rows get over written.
is there any alternative to Arraylist?
Thanks
Uday
Dear Uday,
I had added the code for the multi selected row. I forgot to mentioned for the column.
Created one custom context node and attributes same as table context node and attributes.
Create the object for the custom context node and populate the value with below :-
If only one row selected then you can get the selected row details with currectNode<Node Name> OR get leadSelection then set to the custom context node attribute.
If mulitiple rows selected then you need to loop through for loop and get the current selected element and set to custom context node attribute.
Hope it will helps,
Best Regards
Arun Jaiswal
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.