Hi , I want to create a grid structure in which one cell is related to multiple cells . For Ex.
Rohan MCA BCA BA
Rohit XYZ CA
For this I am using Data Table inside a Data Table . And I want that user can update all the values, I am able to display the data in the above sturcture but , after updating the data and then pressing submit button , the values in the rows getting swapped . Value of last row is overwritten by values in the first row.
Please help me in this , why the value of last row get swapped with value of first row.
I wish I could offer help, all I can add is a 'me too!'. I'm nesting a dataTable within a dataTable and when I click on the commandLink which should take me to a page where I can edit the details of the data contained in the inner table I don't necessarily get the right data. Specifically if the outer table has three rows (each table has only one column) and the inner table has four rows within the first of the outer table's rows, clicking on the inner tables will always return the first of the inner rows. It's bizarre, looking at the HTML it seems like Faces is keeping track of things correctly, but it's not keeping the inner table data straight.
Anybody seen this? Are nested tables not supposed to be done in Faces?
I'm currently too lazy to setup a test-case myself, but if you're using myfaces you might want to do a source-attachment for your myfaces jars. Then in your favourite IDE, set a breakpoint in UIData.java in the queueEvent(FacesEvent event) method and another one in the broadcast(FacesEvent event)function.
The basic outline of these functions is that events fired by children of DataTable are caught by the parent which requests the current row number associated with the particular child, wraps it in a custom event and fires the event up the chain. Then, in broadcast() the DataModel's cursor is set to the saved row number, then the event handler is invoked, and finally the DataModel is restored to the previous row.
In a debugger you can probably see at which point the wrong row gets selected.