myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Litherland" <michael.litherl...@gmail.com>
Subject Nested dataTables
Date Mon, 10 Jul 2006 13:52:22 GMT
Hi,

I'm using MyFaces to display some heirarchical data and to do so I'm
nesting dataTables within each other.  Displaying the data works fine,
but I place commandButtons in the tables so the user can get detailed
information of several different types about the data I'm displaying.
Within the bean it doesn't seem like it differentiates between the
interior tables at all so I always end up with a view of the first
item displayed, not whatever it is I clicked on.

This is a simplified version of what I'm trying to do:

<h:form>
  <h:dataTable value="#{user.grandparentModel}" var="gp">
    <h:column>
      <h:dataTable value="#{gp.parentModel}" var="p">
        <h:column>
          <h:dataTable value="#{p.childModel}" var="c">
            <h:column>
              <h:commandButton value="#{msg.seeChildDetails}"
                  action="#{user.childDetails}"/>
              <h:outputText value="#{c.someDetails}"/>
            </h:column>
          </h:dataTable>
        </h:column>
      </h:dataTable>
    </h:column>
  </h:dataTable>
</h:form>

And in the bean:
public String childDetails() {
        GrandParent gp = (Grandparent) grandparentModel.getRowData();
        Parent p = (Parent) gp.getParentModel().getRowData();
        Child c = (Child) p.getChildModel().getRowData();
        // Do something with c
        return "childDetails";
}

Any clue why this wouldn't work?  I swear I've done something like
this in the RI and I might try it there to see if that works.

Thanks for the help.
Mike

Mime
View raw message