You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Litherland <mi...@gmail.com> on 2006/07/10 15:52:22 UTC
Nested dataTables
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
Re: Re: Nested dataTables
Posted by Michael Litherland <mi...@gmail.com>.
Hi,
Thanks for the advice. I tried it and it didn't help. Do you think
this is a bug? By the way, I'm using the MyFaces that comes with
JBoss 4.0.4.GA and the EJB3 deployment profile. Should I attempt to
upgrade the library jars and see if that helps? I'd like to keep
JBoss as "stock" as possible.
Thanks again,
Mike
On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> Well, I was just looking at a different UIData issue, and I may have
> come across something relevent. Try using t:dataTable with
> preserveRowState=true and see if it fixes this problem. It may cause
> other problems however. I noticed that the JSF RI 1.2 UIData has
> undocumented behavior where it always preserves the row state when
> UIDatas are nested.
>
>
> On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> > 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
> >
>
Re: Re: Re: Nested dataTables
Posted by Michael Litherland <mi...@gmail.com>.
OK, Even with myfaces 1.1.3 and tomahawk 1.1.3 I'm still having this issue.
Any other ideas?
Thanks,
Mike
On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> Yeah, I was using perserveRowStates. I'll try the latest myfaces and
> see if it helps.
>
> Thanks,
> Mike
>
> On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> > On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> > > Thanks for the advice. I tried it and it didn't help. Do you think
> > > this is a bug? By the way, I'm using the MyFaces that comes with
> > > JBoss 4.0.4.GA and the EJB3 deployment profile. Should I attempt to
> > > upgrade the library jars and see if that helps? I'd like to keep
> > > JBoss as "stock" as possible.
> >
> > On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> > > Actually, it's preserveRowStates=true (with an 's')
> >
> > Make sure you're using preserveRowStates and not preserveRowState.
> > This only works for t:dataTable, not h:dataTable, and you'll probably
> > want to put it on all of your dataTables.
> >
> > Can't really help much on the JBoss issues as I don't use it, but that
> > does sound a bit old. preserveRowStates was added on 11/11/2005,
> > which was after Myfaces 1.1.1.
> >
>
Re: Re: Nested dataTables
Posted by Michael Litherland <mi...@gmail.com>.
Yeah, I was using perserveRowStates. I'll try the latest myfaces and
see if it helps.
Thanks,
Mike
On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> > Thanks for the advice. I tried it and it didn't help. Do you think
> > this is a bug? By the way, I'm using the MyFaces that comes with
> > JBoss 4.0.4.GA and the EJB3 deployment profile. Should I attempt to
> > upgrade the library jars and see if that helps? I'd like to keep
> > JBoss as "stock" as possible.
>
> On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> > Actually, it's preserveRowStates=true (with an 's')
>
> Make sure you're using preserveRowStates and not preserveRowState.
> This only works for t:dataTable, not h:dataTable, and you'll probably
> want to put it on all of your dataTables.
>
> Can't really help much on the JBoss issues as I don't use it, but that
> does sound a bit old. preserveRowStates was added on 11/11/2005,
> which was after Myfaces 1.1.1.
>
Re: Nested dataTables
Posted by Mike Kienenberger <mk...@gmail.com>.
On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> Thanks for the advice. I tried it and it didn't help. Do you think
> this is a bug? By the way, I'm using the MyFaces that comes with
> JBoss 4.0.4.GA and the EJB3 deployment profile. Should I attempt to
> upgrade the library jars and see if that helps? I'd like to keep
> JBoss as "stock" as possible.
On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> Actually, it's preserveRowStates=true (with an 's')
Make sure you're using preserveRowStates and not preserveRowState.
This only works for t:dataTable, not h:dataTable, and you'll probably
want to put it on all of your dataTables.
Can't really help much on the JBoss issues as I don't use it, but that
does sound a bit old. preserveRowStates was added on 11/11/2005,
which was after Myfaces 1.1.1.
Re: Nested dataTables
Posted by Mike Kienenberger <mk...@gmail.com>.
Actually, it's preserveRowStates=true (with an 's')
On 7/10/06, Mike Kienenberger <mk...@gmail.com> wrote:
> Well, I was just looking at a different UIData issue, and I may have
> come across something relevent. Try using t:dataTable with
> preserveRowState=true and see if it fixes this problem. It may cause
> other problems however. I noticed that the JSF RI 1.2 UIData has
> undocumented behavior where it always preserves the row state when
> UIDatas are nested.
>
>
> On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> > 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
> >
>
Re: Nested dataTables
Posted by Mike Kienenberger <mk...@gmail.com>.
Well, I was just looking at a different UIData issue, and I may have
come across something relevent. Try using t:dataTable with
preserveRowState=true and see if it fixes this problem. It may cause
other problems however. I noticed that the JSF RI 1.2 UIData has
undocumented behavior where it always preserves the row state when
UIDatas are nested.
On 7/10/06, Michael Litherland <mi...@gmail.com> wrote:
> 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
>