-Train in a bounded task flow with page fragments for the views/train stops
I gather information in each train stop that I want to display in the last page fragment, which includes a table, which in turn (following "Displaying an empty table !" example) I want to display with only the selected rows by the user in the previous train stops (the table has already data that I don't want to show). In the method call activity I use the executeEmptyRowSet() on the correspondent VO and then I add only the information of the selected rows (that belong by the way to different VO's). That works well the first time, but when the user goes back to a previous train stop and then returns to the summary page, although the method executeEmptyRowSet() is executed, the VO display the last inserted rows and the new ones.
Here is the AM method exposed:
|public void copyCursosProgEsp ()|
|ViewObjectImpl estudiantesCursosVO = getEstudianteCursos1();|
|//create a second row set for the vo to not impact the row set|
|RowSet duplicateRowSet = getCursosPeriodoVOExPrgEsp1().createRowSet("duplicateRowSet");|
|//set rowset to first row to avoid "attempt to access dead row" exception|
|//get all rows that have the transient attribute "Marcado" set to true|
|Row selectedRows = duplicateRowSet.getFilteredRows("Marcado", true);|
|for(Row rw : selectedRows)|
|Row newRow = estudiantesCursosVO.getRowSetIterator().createRow();|
In summary: I want to display only the newly created rows in the last train stop with the info gathered in the previous train stops. How can I achieve this?
Thanks in advance.
Thanks a lot Linda,
I tried your suggestion. It works. It looks cleaner. I would like to empty the table every time the page fragment loads, so I can programmatically add only the data selected by the user in the previous train stops. If I iterate through this VO trying to delete the rows, all the rows from the correspondent DB table are deleted, not only the newly added. It would be like executing a rollback only on this particular VO.
Thanks in advance
Thanks Linda for taking the time.
For some reason executeEmptyRowSet() seems not to work. What I did was to iterate through the VO rows and call row.refresh(Row.REFRESH_REMOVE_NEW_ROWS) as someone suggested in "Rollback" changes from a single View Object before inserting the new rows.