on 06-28-2007 10:59 AM
Hi All,
I am facing a problem with row selection in a table. When I navigate from one screen to another in my application, the selected rows in the previous screen should be populated in the table in the next screen.
If I have to use checkboxes inside the table for multiple row selection, how could I populate the table in the next screen with all the selected rows of the table from the previous screen.
Also, is it possible to select multiple rows in a table without using checkboxes, and by selecting the "selection mode" of table as "multi", so that initially when the page is loaded no record (row) should be selected automatically.
Please help me regarding this.
Regards,
Murthy.
Hi,
For Checkbox approach, first create one more node with same structure and map to second view. At the time of navigation to second page, put value to this node from first node as per the checkbox entry.
Eg:
for(i=0;i<firstNode.size();i++)
{
if(firstNodeElement.getCheckbox()==true)
{
firstEl=firstNode.getFirstElementAt(i);
secondNodeEl=secondNode.createElement();
secondNode.addElement(secondNodeEl)
secondEl.setVal1(firstEl.getVal1());
secondEl.setVal2(firstEl.getVal2());
}
}
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As Armin suggested you can use the inbuilt multiselection property of the table.
For populating the selected values in a table in second view
First view Context structure
-EmpDetails (Table node) (cardinality 0..n,selection 0..n,intializeleadSelection - false)
---EmpID (table column)
---Name (table column)
Second View Context structure
-DispalySelected (Table node)-EmpDetails (Table node) (cardinality 0..n,intializeleadSelection - false)
--- ID(table column)
--- Name(table column)
create a navigation link form first view to second view
In the InBoundPlug of second view
wdContext.nodeDisplaySelected().invalidate();
for(int i=0;i<wdContext.nodeEmpDetails().size();i++)
{
if(wdContext.nodeEmpDetails().isMultiSelected(i))
{
IPrivateDisplayView.IDisplaySelectedElement ele = wdContext.nodeDisplaySelected().createDisplaySelectedElement();
wdContext.nodeDisplaySelected().addElement(ele);
ele.setID(wdContext.nodeEmpDetails().getEmpDetailsElementAt(i).getEmpID());
ele.setName(wdContext.nodeEmpDetails().getEmpDetailsElementAt(i).getName());
}
}
<b>For multiselecting you have to use Ctrl tab</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest not using check boxes but the built-in multiselection capability of the table. Just set the selection cardinality of the data source node to 0:N instead of 0:1 and set the selection mode of the table to (default value) "auto".
To avoid having the first row selected initially, set the "initializeLeadSelection" property of the data source node to false.
To get the selected rows in the second table, implement a supply function for the second table's data source node that iterates over the (multi-)selected elements of the first node and adds them to the second node.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murthy..
You can select multiple rows of the table...
This can be done by using the Button...
Urs GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.