• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

DataTable inside a DataTable

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I want to create a grid structure in which one cell is related to multiple cells . For Ex.



Name Degree

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.

If you want to see the code I can send that also.


Thanks in advance.


Rohan
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks!
Mike
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please post the code for the jsp. I've done tables in tables and they work fine if you link data properly.
 
Greenhorn
Posts: 18
Tomcat Server Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gerardo Tasistro,

I am also using datatable inside the datatable and facing following errors:

java.lang.IllegalArgumentException: argument type mismatch
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

org.apache.jasper.JasperException: Exception in JSP: /pages/phoneticsPDEPage.jsp:543

540: <h:commandButton value="" id="targetLanguageButton" style="visibility:hidden;" styleClass="button"
541: disabled="#{trk.saveDisable}" action="#{phoneticslde.dataTableTargetLanguageChange}">
542: </h:commandButton>
543: <t:dataTable id="ldeheaderTable" value="#{lde.ldelist}"
544: var="lde" width="100%" border="0" cellpadding="0" cellspacing="0"
545: binding="#{ldeBean.numOfRowInSubCollection}"
546: styleClass="headingBgcolor menuTBold1 dataTable"


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)

Please find my JSP Code below:



************************************************************************************************

Here is my Java Code:

************************************************************************************************




Please help me out ...

-
Navdeep
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic