This discussion is archived
4 Replies Latest reply: Sep 6, 2012 1:31 AM by 959950 RSS

Nested Dynamic h:datatable

959950 Newbie
Currently Being Moderated
I also have similar issue with nesting of dataTables as stated in https://forums.oracle.com/forums/thread.jspa?messageID=10559636#10559636



Can you please help on how the assign the binding value for the inner datatable as i have to add columns dynamically to it.

<t:dataList binding="#{backingBean.outerDataTableGUI}" value="#{backingBean.outerTableArrayList}" var="outerRowData">
<h:panelGroup>
<h:datatable binding="????????" value="#{outerRowData.innerTableArrayList}"> //*should be binding="#{outerRowData.innerDataTableGUI}"*
</h:datatable>
</h:panelGroup>
</t:dataList>
  • 1. Re: Nested Dynamic h:datatable
    EJP Guru
    Currently Being Moderated
    should be binding="#{outerRowData.innerDataTableGUI}"
    So what happens when you do that?
  • 2. Re: Nested Dynamic h:datatable
    959950 Newbie
    Currently Being Moderated
    It throws below error when i use binding="#{outerRowData.innerDataTableGUI}"

    javax.servlet.ServletException: Error setting property 'innerDataTableGUI' in bean of type null
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:658)
  • 3. Re: Nested Dynamic h:datatable
    EJP Guru
    Currently Being Moderated
    Yeah, I can see why it's doing that, the bindings are all being evaluated at the same time so there is no iteration over the table values yet. Do you have to use bindings? It might be simpler to just use the value= attribute and ensure the backing bean has getters and setters for a suitable table, and it might also work with the nested table.
  • 4. Re: Nested Dynamic h:datatable
    959950 Newbie
    Currently Being Moderated
    I have to use binding inorder to add columns at runtime to the innerTable based on outerRowData

    I tried having a backing bean property for the inner table as below:

    getInnerTableGui(){
    return   innerTableGui =( (OuterTableRowData)getOuterTableGui().getRowData()).getInnerTableGui();
    }

    problem is it is getting called onlyonce..and the first row data is applied to all other rows.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points