myfaces-users mailing list archives

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

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:dataTable value="#{user.grandparentModel}" var="gp">
      <h:dataTable value="#{gp.parentModel}" var="p">
          <h:dataTable value="#{p.childModel}" var="c">
              <h:commandButton value="#{msg.seeChildDetails}"
              <h:outputText value="#{c.someDetails}"/>

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.

View raw message