cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple row selection in Table

Former Member
0 Kudos

Hi Experts,

I have created one popup with a table inside that.

My question is how can i add multiple rows, enter value in those rows and on clicking the

copy button all the value in the rows will be copied into the main view.

All the rows should be editable.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You don't need to copy the edited values. Create a suitable context node, say "Rows" for the table rows in the component controller and map this context from the view controllers of the main view and the view inside the popup.

To create table rows you just have to create elements in the "Rows" node:


IRowsElement row = wdContext.nodeRows().createAndAddRowsElement();

To create a new row you could for example add a ToolBar with a ToolBarButton to the table. Or you could add a button in the last table column which is only visible in the last table row.

After closing the popup, the edited table rows are still available in the context node "Rows" of the component controller and the main view controller.

Armin

Former Member
0 Kudos

Hi Armin,

Thanks a lot for the reply.

In my application when i am selecting the multiple rows which i entered earlier in the popup window, it's getting populated into main window.

But in main window only one input field is there,so only the fiest record is getting displyed after selection.

Rest of the records i am not able to display in the main window.And the problem is i can't add more than one input field in main window. Rest of the values will be passed into R3 through coding but it can't be displayed on screen.

So please advice me on these two scenarios.

1 . How to populate multiple row values(input fields in popup window with value enterd by user) into

main view. In main view only one input field is there.

2 . How to pass all the selected values from main window to R3 by webdynpro coding.

All the values coming from popup need to be passed even though only one value is displayed.

Here the input field in main window is mapped to one model attrribute.

Thanks a lot.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi srini,

just add some code in your method add...

suppose you have number of row then you will get Size of table..

existing node which is binding your table where you select number of row..

table-value node--table.

copy node--value node --row.

int size=wdContext.nodeTable().size();

int lead=wdContext.nodeTable().getLeadSelection();

for(int i=size-1;i<=0;i--)

{

if(wdContext.nodeTable().isMultiselection(i) || lead=i)

{

Iprivate<view name>.IRowElement ele=wdContext.nodeRow().createRowElement();

//your attribute name of row node--Name.

//your attribute name of Table node:Name

ele.set<your attribute name of row node>(wdContext.nodeTable().getTableElementAt(i).getName();

wdContext.nodeRow().addElement(ele);

}

}

Hope this wiil, work

sudhira

Edited by: sudhir kumar on Mar 25, 2009 6:02 AM

nikhil_bose
Active Contributor
0 Kudos

1. Create 'Table' node in the component controller.

2. Map this context to Main View and Popup View

elements or Rows created in Popview are avaiable in all controllers.

If Rows need to be edited- go to view's layout

1. For each TableColumn, remove the default TextView TableCellEditor and put InputField as TableCellEditor, bind the attribute.

Create new rows in popup:


IPrivate<ComponentName>View.ITableElement newrow = wdContext.createTableElement();
//create element
wdContext.nodeTable().addElement( newrow); // add to row

nikhil

Former Member
0 Kudos

Thanks a lot for the reply Nikhil.

In my application when i am selecting the multiple rows which i entered earlier in the popup window, it's getting populated into main window.

But in main window only one input field is there,so only the fiest record is getting displyed after selection.

Rest of the records i am not able to display in the main window.And the problem is i can't add more than one input field in main window. Rest of the values will be passed into R3 through coding but it can't be displayed on screen.

So please advice me on these two scenarios.

1 . How to populate multiple row values(input fields in popup window with value enterd by user) into

main view. In main view only one input field is there.

2 . How to pass all the selected values from main window to R3 by webdynpro coding.

All the values coming from popup need to be passed even though only one value is displayed.

Here the input field in main window is mapped to one model attrribute.

Thanks a lot.