3 Replies Latest reply on Dec 6, 2007 8:10 PM by John Tsimikas

    Embededding <h:dataTable> within <h:dataTable>

    John Tsimikas Newbie

      I have an dataTable that is embedded with another dataTable
      I am using the same @DataModel to reference all the data in
      both dataTables.

      Seems that when I submit the form, only the data within the inner dataTable is "set". The fields in the outer dataTable never get set.

      Let me start by asking, has anyone done this successfully?
      Any enlightenment would be appreciated.

        • 1. Nesting h:dataTable (Can't be done?)
          John Tsimikas Newbie

          I removed the inner <h:dataTable> and this now allows the outer <h:dataTable> to work properly when previously it was not.

          So it seems you CAN NOT nest <h:dataTables>.

          Although no error messages of any kind are displayed (c'mon how about some error messages). After setting breakpoints in the setters, I found only one set of datatable's setters were being called.

          When I had the nested tables, the inner datatable setters were called but not the outer datatable. When I removed the inner datatable, the outer datatable setters then got called.

          This means, I now have to construct another web page for the inner <h:dataTable>. I can't say that I'm really excited about doing this.

          Has anybody worked with nested <h:datatables> and got it working.
          If so can you please......................

          reply with some code that I can look at.

          • 2. Re: Embededding <h:dataTable> within <h:dataTable>
            Pete Muir Master

            I think the problem is to do with runtime vs. compiletime components (so nested datatables won't work). It should work inside a c:forEach or the like.

            • 3. Re: Embededding <h:dataTable> within <h:dataTable>
              John Tsimikas Newbie

              I actually got the inner and outer <h:dataTable> to work together.

              After spending quite a bit of time disecting the code line by line,
              it turns out that the rendered attribute was the root of the problems.

              ex. rendered= "#{scsSectionDefinition.allowCriteria == 'Y'}"

              Some of the edit fields include a rendered attribute. Once I removed
              the rendered attribute, everything works fine. All data is submitted an set properly in the @DataModel component.

              Now I'm just really baffled why does removing the rendered attributes fix my code. Not to mention I really need to have the rendered attribute for some instances.