You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by se...@softwaredelcentro.com.ar on 2006/08/28 16:13:06 UTC
Re: ClassCastException
I have the same Exception if I do something like this:
<af:table ...>
<c:forEach var="col" items="#{page.columns}">
<af:column ...>
</c:forEach>
</af:table>
Any idea?
Thanks,
Sebastian
> Hi!
>
> I don't know whether the following is a problem in Trinidad or in
> Facelets, so I start a new topic here, even though this is related to my
> other posting "Throw explanatory exception in PanelTabbedRenderer for
> wrong typed childs?".
>
> When I try to use a binding="#{someBean.someSetter}" in a tr:panelTabbed
> tag there is not one child returned by component.getChildren() in
> PanelTabbedRenderer but seven. First child is a
> com.sun.facelets.compiler.UIInstructions so we get a ClassCastException. I
> don't know whether it is ok for Facelets to insert these UIInstructions
> and PanelTabbedRenderer should cope with them or perhaps Facelets is doing
> wrong here. Or maybe I do something real stupid?
>
> Any pointers welcome...
>
> Thanks,
> Thorsten
>
>
>
> 7 child's:
> -------------
> <tr:panelTabbed position="both"
> binding="#{sammelgruppenDetailView.panelTabbed}" >
> <tr:showDetailItem text="testTab">
> <tr:outputText value="testText"></tr:outputText>
> </tr:showDetailItem>
> </tr:panelTabbed>
> -------------
>
>
> 1 child:
> -------------
> <tr:panelTabbed position="both" >
> <tr:showDetailItem text="testTab">
> <tr:outputText value="testText"></tr:outputText>
> </tr:showDetailItem>
> </tr:panelTabbed>
> -------------
>
>
Re: ClassCastException
Posted by Arnaud MERGEY <am...@sunopsis.com>.
Hi,
I remember a similar problem, I had a ClassCastException with dynamic
column in table and af:iterator. I think you can only use *tr:forEach*
with trinidad table
try to use *af:forEach* instead of *c:forEach
*
<af:table ...>
<af:forEach var="col" items="#{page.columns}">
<af:column ...>
</af:forEach>
</af:table>
Arnaud
Simon Lessard a écrit :
> Another way would be to add all possible columns to the table and use
> their
> rendered attribute, but depanding on the use case that option might
> not be
> desirable.
>
> On 8/28/06, Simon Lessard <si...@gmail.com> wrote:
>>
>> Hello again,
>>
>> I think this case is a good example of the binding attribute usage. You
>> could bind the table to a managed bean and when the getTable() method
>> get
>> called, you add thewanted columns and/or remove the now unwanted ones.
>>
>>
>> Regards,
>>
>> ~ Simon
>>
>>
>> On 8/28/06, Simon Lessard <si...@gmail.com> wrote:
>> >
>> > Oh you're right, I read it too fast. Hmm I'll think a bit about
>> that one
>> > and come back with a solution.
>> >
>> >
>> > On 8/28/06, Pablo Saavedra < pablo.a.saavedra@gmail.com> wrote:
>> > >
>> > > I agree this belongs to the user mailing lists, but since we are
>> > > already
>> > > here...
>> > >
>> > > The code you propose would iterate over #{page.columns} but using
>> each
>> > > elements as a row. I think what sebastian wants is to dinamically
>> set
>> > > the
>> > > table's columns (at build time) to later populate it with rows.
>> > >
>> > > I have no idea why the classCast exception is happening, though.
>> > >
>> > > Regards.
>> > >
>> > > 2006/8/28, Simon Lessard < simon.lessard.3@gmail.com>:
>> > > >
>> > > > Not sure since I don't use Facelets what often. However, using
>> > > c:foreach
>> > > > with a JSF application is never a good idea unless you're using
>> JSF
>> > > > 1.2.Inyour case I would rather use something like:
>> > > >
>> > > > <af:table value="#{page.columns}" var="col">
>> > > > <af:column ...>
>> > > > </af:table>
>> > > >
>> > > >
>> > > > Regards,
>> > > >
>> > > > ~ Simon
>> > > >
>> > > > p.s. I think this kind of discussion belong to the user mailing
>> > > list.
>> > > >
>> > > > On 8/28/06, sebastian.fiorentini@softwaredelcentro.com.ar <
>> > > > sebastian.fiorentini@softwaredelcentro.com.ar > wrote:
>> > > > >
>> > > > > I have the same Exception if I do something like this:
>> > > > >
>> > > > > <af:table ...>
>> > > > > <c:forEach var="col" items="#{page.columns}">
>> > > > > <af:column ...>
>> > > > > </c:forEach>
>> > > > > </af:table>
>> > > > >
>> > > > > Any idea?
>> > > > >
>> > > > > Thanks,
>> > > > > Sebastian
>> > > > >
>> > > > > > Hi!
>> > > > > >
>> > > > > > I don't know whether the following is a problem in Trinidad or
>> > > in
>> > > > > > Facelets, so I start a new topic here, even though this is
>> > > related to
>> > > > my
>> > > > > > other posting "Throw explanatory exception in
>> > > PanelTabbedRenderer for
>> > > > > > wrong typed childs?".
>> > > > > >
>> > > > > > When I try to use a binding="#{someBean.someSetter}" in a
>> > > > tr:panelTabbed
>> > > > > > tag there is not one child returned by component.getChildren()
>> > > in
>> > > > > > PanelTabbedRenderer but seven. First child is a
>> > > > > > com.sun.facelets.compiler.UIInstructions so we get a
>> > > > ClassCastException.
>> > > > > I
>> > > > > > don't know whether it is ok for Facelets to insert these
>> > > > UIInstructions
>> > > > > > and PanelTabbedRenderer should cope with them or perhaps
>> > > Facelets is
>> > > > > doing
>> > > > > > wrong here. Or maybe I do something real stupid?
>> > > > > >
>> > > > > > Any pointers welcome...
>> > > > > >
>> > > > > > Thanks,
>> > > > > > Thorsten
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > > 7 child's:
>> > > > > > -------------
>> > > > > > <tr:panelTabbed position="both"
>> > > > > > binding="#{sammelgruppenDetailView.panelTabbed}" >
>> > > > > > <tr:showDetailItem text="testTab">
>> > > > > > <tr:outputText
>> > > value="testText"></tr:outputText>
>> > > > > > </tr:showDetailItem>
>> > > > > > </tr:panelTabbed>
>> > > > > > -------------
>> > > > > >
>> > > > > >
>> > > > > > 1 child:
>> > > > > > -------------
>> > > > > > <tr:panelTabbed position="both" >
>> > > > > > <tr:showDetailItem text="testTab">
>> > > > > > <tr:outputText
>> > > value="testText"></tr:outputText>
>> > > > > > </tr:showDetailItem>
>> > > > > > </tr:panelTabbed>
>> > > > > > -------------
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > >
>> > >
>> >
>>
>
Re: ClassCastException
Posted by Simon Lessard <si...@gmail.com>.
Another way would be to add all possible columns to the table and use their
rendered attribute, but depanding on the use case that option might not be
desirable.
On 8/28/06, Simon Lessard <si...@gmail.com> wrote:
>
> Hello again,
>
> I think this case is a good example of the binding attribute usage. You
> could bind the table to a managed bean and when the getTable() method get
> called, you add thewanted columns and/or remove the now unwanted ones.
>
>
> Regards,
>
> ~ Simon
>
>
> On 8/28/06, Simon Lessard <si...@gmail.com> wrote:
> >
> > Oh you're right, I read it too fast. Hmm I'll think a bit about that one
> > and come back with a solution.
> >
> >
> > On 8/28/06, Pablo Saavedra < pablo.a.saavedra@gmail.com> wrote:
> > >
> > > I agree this belongs to the user mailing lists, but since we are
> > > already
> > > here...
> > >
> > > The code you propose would iterate over #{page.columns} but using each
> > > elements as a row. I think what sebastian wants is to dinamically set
> > > the
> > > table's columns (at build time) to later populate it with rows.
> > >
> > > I have no idea why the classCast exception is happening, though.
> > >
> > > Regards.
> > >
> > > 2006/8/28, Simon Lessard < simon.lessard.3@gmail.com>:
> > > >
> > > > Not sure since I don't use Facelets what often. However, using
> > > c:foreach
> > > > with a JSF application is never a good idea unless you're using JSF
> > > > 1.2.Inyour case I would rather use something like:
> > > >
> > > > <af:table value="#{page.columns}" var="col">
> > > > <af:column ...>
> > > > </af:table>
> > > >
> > > >
> > > > Regards,
> > > >
> > > > ~ Simon
> > > >
> > > > p.s. I think this kind of discussion belong to the user mailing
> > > list.
> > > >
> > > > On 8/28/06, sebastian.fiorentini@softwaredelcentro.com.ar <
> > > > sebastian.fiorentini@softwaredelcentro.com.ar > wrote:
> > > > >
> > > > > I have the same Exception if I do something like this:
> > > > >
> > > > > <af:table ...>
> > > > > <c:forEach var="col" items="#{page.columns}">
> > > > > <af:column ...>
> > > > > </c:forEach>
> > > > > </af:table>
> > > > >
> > > > > Any idea?
> > > > >
> > > > > Thanks,
> > > > > Sebastian
> > > > >
> > > > > > Hi!
> > > > > >
> > > > > > I don't know whether the following is a problem in Trinidad or
> > > in
> > > > > > Facelets, so I start a new topic here, even though this is
> > > related to
> > > > my
> > > > > > other posting "Throw explanatory exception in
> > > PanelTabbedRenderer for
> > > > > > wrong typed childs?".
> > > > > >
> > > > > > When I try to use a binding="#{someBean.someSetter}" in a
> > > > tr:panelTabbed
> > > > > > tag there is not one child returned by component.getChildren()
> > > in
> > > > > > PanelTabbedRenderer but seven. First child is a
> > > > > > com.sun.facelets.compiler.UIInstructions so we get a
> > > > ClassCastException.
> > > > > I
> > > > > > don't know whether it is ok for Facelets to insert these
> > > > UIInstructions
> > > > > > and PanelTabbedRenderer should cope with them or perhaps
> > > Facelets is
> > > > > doing
> > > > > > wrong here. Or maybe I do something real stupid?
> > > > > >
> > > > > > Any pointers welcome...
> > > > > >
> > > > > > Thanks,
> > > > > > Thorsten
> > > > > >
> > > > > >
> > > > > >
> > > > > > 7 child's:
> > > > > > -------------
> > > > > > <tr:panelTabbed position="both"
> > > > > > binding="#{sammelgruppenDetailView.panelTabbed}" >
> > > > > > <tr:showDetailItem text="testTab">
> > > > > > <tr:outputText
> > > value="testText"></tr:outputText>
> > > > > > </tr:showDetailItem>
> > > > > > </tr:panelTabbed>
> > > > > > -------------
> > > > > >
> > > > > >
> > > > > > 1 child:
> > > > > > -------------
> > > > > > <tr:panelTabbed position="both" >
> > > > > > <tr:showDetailItem text="testTab">
> > > > > > <tr:outputText
> > > value="testText"></tr:outputText>
> > > > > > </tr:showDetailItem>
> > > > > > </tr:panelTabbed>
> > > > > > -------------
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Re: ClassCastException
Posted by Simon Lessard <si...@gmail.com>.
Hello again,
I think this case is a good example of the binding attribute usage. You
could bind the table to a managed bean and when the getTable() method get
called, you add thewanted columns and/or remove the now unwanted ones.
Regards,
~ Simon
On 8/28/06, Simon Lessard <si...@gmail.com> wrote:
>
> Oh you're right, I read it too fast. Hmm I'll think a bit about that one
> and come back with a solution.
>
>
> On 8/28/06, Pablo Saavedra < pablo.a.saavedra@gmail.com> wrote:
> >
> > I agree this belongs to the user mailing lists, but since we are already
> >
> > here...
> >
> > The code you propose would iterate over #{page.columns} but using each
> > elements as a row. I think what sebastian wants is to dinamically set
> > the
> > table's columns (at build time) to later populate it with rows.
> >
> > I have no idea why the classCast exception is happening, though.
> >
> > Regards.
> >
> > 2006/8/28, Simon Lessard <si...@gmail.com>:
> > >
> > > Not sure since I don't use Facelets what often. However, using
> > c:foreach
> > > with a JSF application is never a good idea unless you're using JSF
> > > 1.2.Inyour case I would rather use something like:
> > >
> > > <af:table value="#{page.columns}" var="col">
> > > <af:column ...>
> > > </af:table>
> > >
> > >
> > > Regards,
> > >
> > > ~ Simon
> > >
> > > p.s. I think this kind of discussion belong to the user mailing list.
> > >
> > > On 8/28/06, sebastian.fiorentini@softwaredelcentro.com.ar <
> > > sebastian.fiorentini@softwaredelcentro.com.ar > wrote:
> > > >
> > > > I have the same Exception if I do something like this:
> > > >
> > > > <af:table ...>
> > > > <c:forEach var="col" items="#{page.columns}">
> > > > <af:column ...>
> > > > </c:forEach>
> > > > </af:table>
> > > >
> > > > Any idea?
> > > >
> > > > Thanks,
> > > > Sebastian
> > > >
> > > > > Hi!
> > > > >
> > > > > I don't know whether the following is a problem in Trinidad or in
> > > > > Facelets, so I start a new topic here, even though this is related
> > to
> > > my
> > > > > other posting "Throw explanatory exception in PanelTabbedRenderer
> > for
> > > > > wrong typed childs?".
> > > > >
> > > > > When I try to use a binding="#{someBean.someSetter}" in a
> > > tr:panelTabbed
> > > > > tag there is not one child returned by component.getChildren() in
> > > > > PanelTabbedRenderer but seven. First child is a
> > > > > com.sun.facelets.compiler.UIInstructions so we get a
> > > ClassCastException.
> > > > I
> > > > > don't know whether it is ok for Facelets to insert these
> > > UIInstructions
> > > > > and PanelTabbedRenderer should cope with them or perhaps Facelets
> > is
> > > > doing
> > > > > wrong here. Or maybe I do something real stupid?
> > > > >
> > > > > Any pointers welcome...
> > > > >
> > > > > Thanks,
> > > > > Thorsten
> > > > >
> > > > >
> > > > >
> > > > > 7 child's:
> > > > > -------------
> > > > > <tr:panelTabbed position="both"
> > > > > binding="#{sammelgruppenDetailView.panelTabbed}" >
> > > > > <tr:showDetailItem text="testTab">
> > > > > <tr:outputText
> > value="testText"></tr:outputText>
> > > > > </tr:showDetailItem>
> > > > > </tr:panelTabbed>
> > > > > -------------
> > > > >
> > > > >
> > > > > 1 child:
> > > > > -------------
> > > > > <tr:panelTabbed position="both" >
> > > > > <tr:showDetailItem text="testTab">
> > > > > <tr:outputText
> > value="testText"></tr:outputText>
> > > > > </tr:showDetailItem>
> > > > > </tr:panelTabbed>
> > > > > -------------
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
Re: ClassCastException
Posted by Simon Lessard <si...@gmail.com>.
Oh you're right, I read it too fast. Hmm I'll think a bit about that one and
come back with a solution.
On 8/28/06, Pablo Saavedra <pa...@gmail.com> wrote:
>
> I agree this belongs to the user mailing lists, but since we are already
> here...
>
> The code you propose would iterate over #{page.columns} but using each
> elements as a row. I think what sebastian wants is to dinamically set the
> table's columns (at build time) to later populate it with rows.
>
> I have no idea why the classCast exception is happening, though.
>
> Regards.
>
> 2006/8/28, Simon Lessard <si...@gmail.com>:
> >
> > Not sure since I don't use Facelets what often. However, using c:foreach
> > with a JSF application is never a good idea unless you're using JSF
> > 1.2.Inyour case I would rather use something like:
> >
> > <af:table value="#{page.columns}" var="col">
> > <af:column ...>
> > </af:table>
> >
> >
> > Regards,
> >
> > ~ Simon
> >
> > p.s. I think this kind of discussion belong to the user mailing list.
> >
> > On 8/28/06, sebastian.fiorentini@softwaredelcentro.com.ar <
> > sebastian.fiorentini@softwaredelcentro.com.ar> wrote:
> > >
> > > I have the same Exception if I do something like this:
> > >
> > > <af:table ...>
> > > <c:forEach var="col" items="#{page.columns}">
> > > <af:column ...>
> > > </c:forEach>
> > > </af:table>
> > >
> > > Any idea?
> > >
> > > Thanks,
> > > Sebastian
> > >
> > > > Hi!
> > > >
> > > > I don't know whether the following is a problem in Trinidad or in
> > > > Facelets, so I start a new topic here, even though this is related
> to
> > my
> > > > other posting "Throw explanatory exception in PanelTabbedRenderer
> for
> > > > wrong typed childs?".
> > > >
> > > > When I try to use a binding="#{someBean.someSetter}" in a
> > tr:panelTabbed
> > > > tag there is not one child returned by component.getChildren() in
> > > > PanelTabbedRenderer but seven. First child is a
> > > > com.sun.facelets.compiler.UIInstructions so we get a
> > ClassCastException.
> > > I
> > > > don't know whether it is ok for Facelets to insert these
> > UIInstructions
> > > > and PanelTabbedRenderer should cope with them or perhaps Facelets is
> > > doing
> > > > wrong here. Or maybe I do something real stupid?
> > > >
> > > > Any pointers welcome...
> > > >
> > > > Thanks,
> > > > Thorsten
> > > >
> > > >
> > > >
> > > > 7 child's:
> > > > -------------
> > > > <tr:panelTabbed position="both"
> > > > binding="#{sammelgruppenDetailView.panelTabbed}" >
> > > > <tr:showDetailItem text="testTab">
> > > > <tr:outputText
> value="testText"></tr:outputText>
> > > > </tr:showDetailItem>
> > > > </tr:panelTabbed>
> > > > -------------
> > > >
> > > >
> > > > 1 child:
> > > > -------------
> > > > <tr:panelTabbed position="both" >
> > > > <tr:showDetailItem text="testTab">
> > > > <tr:outputText
> value="testText"></tr:outputText>
> > > > </tr:showDetailItem>
> > > > </tr:panelTabbed>
> > > > -------------
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
Re: ClassCastException
Posted by Pablo Saavedra <pa...@gmail.com>.
I agree this belongs to the user mailing lists, but since we are already
here...
The code you propose would iterate over #{page.columns} but using each
elements as a row. I think what sebastian wants is to dinamically set the
table's columns (at build time) to later populate it with rows.
I have no idea why the classCast exception is happening, though.
Regards.
2006/8/28, Simon Lessard <si...@gmail.com>:
>
> Not sure since I don't use Facelets what often. However, using c:foreach
> with a JSF application is never a good idea unless you're using JSF
> 1.2.Inyour case I would rather use something like:
>
> <af:table value="#{page.columns}" var="col">
> <af:column ...>
> </af:table>
>
>
> Regards,
>
> ~ Simon
>
> p.s. I think this kind of discussion belong to the user mailing list.
>
> On 8/28/06, sebastian.fiorentini@softwaredelcentro.com.ar <
> sebastian.fiorentini@softwaredelcentro.com.ar> wrote:
> >
> > I have the same Exception if I do something like this:
> >
> > <af:table ...>
> > <c:forEach var="col" items="#{page.columns}">
> > <af:column ...>
> > </c:forEach>
> > </af:table>
> >
> > Any idea?
> >
> > Thanks,
> > Sebastian
> >
> > > Hi!
> > >
> > > I don't know whether the following is a problem in Trinidad or in
> > > Facelets, so I start a new topic here, even though this is related to
> my
> > > other posting "Throw explanatory exception in PanelTabbedRenderer for
> > > wrong typed childs?".
> > >
> > > When I try to use a binding="#{someBean.someSetter}" in a
> tr:panelTabbed
> > > tag there is not one child returned by component.getChildren() in
> > > PanelTabbedRenderer but seven. First child is a
> > > com.sun.facelets.compiler.UIInstructions so we get a
> ClassCastException.
> > I
> > > don't know whether it is ok for Facelets to insert these
> UIInstructions
> > > and PanelTabbedRenderer should cope with them or perhaps Facelets is
> > doing
> > > wrong here. Or maybe I do something real stupid?
> > >
> > > Any pointers welcome...
> > >
> > > Thanks,
> > > Thorsten
> > >
> > >
> > >
> > > 7 child's:
> > > -------------
> > > <tr:panelTabbed position="both"
> > > binding="#{sammelgruppenDetailView.panelTabbed}" >
> > > <tr:showDetailItem text="testTab">
> > > <tr:outputText value="testText"></tr:outputText>
> > > </tr:showDetailItem>
> > > </tr:panelTabbed>
> > > -------------
> > >
> > >
> > > 1 child:
> > > -------------
> > > <tr:panelTabbed position="both" >
> > > <tr:showDetailItem text="testTab">
> > > <tr:outputText value="testText"></tr:outputText>
> > > </tr:showDetailItem>
> > > </tr:panelTabbed>
> > > -------------
> > >
> > >
> >
> >
> >
>
>
Re: ClassCastException
Posted by Simon Lessard <si...@gmail.com>.
Not sure since I don't use Facelets what often. However, using c:foreach
with a JSF application is never a good idea unless you're using JSF
1.2.Inyour case I would rather use something like:
<af:table value="#{page.columns}" var="col">
<af:column ...>
</af:table>
Regards,
~ Simon
p.s. I think this kind of discussion belong to the user mailing list.
On 8/28/06, sebastian.fiorentini@softwaredelcentro.com.ar <
sebastian.fiorentini@softwaredelcentro.com.ar> wrote:
>
> I have the same Exception if I do something like this:
>
> <af:table ...>
> <c:forEach var="col" items="#{page.columns}">
> <af:column ...>
> </c:forEach>
> </af:table>
>
> Any idea?
>
> Thanks,
> Sebastian
>
> > Hi!
> >
> > I don't know whether the following is a problem in Trinidad or in
> > Facelets, so I start a new topic here, even though this is related to my
> > other posting "Throw explanatory exception in PanelTabbedRenderer for
> > wrong typed childs?".
> >
> > When I try to use a binding="#{someBean.someSetter}" in a tr:panelTabbed
> > tag there is not one child returned by component.getChildren() in
> > PanelTabbedRenderer but seven. First child is a
> > com.sun.facelets.compiler.UIInstructions so we get a ClassCastException.
> I
> > don't know whether it is ok for Facelets to insert these UIInstructions
> > and PanelTabbedRenderer should cope with them or perhaps Facelets is
> doing
> > wrong here. Or maybe I do something real stupid?
> >
> > Any pointers welcome...
> >
> > Thanks,
> > Thorsten
> >
> >
> >
> > 7 child's:
> > -------------
> > <tr:panelTabbed position="both"
> > binding="#{sammelgruppenDetailView.panelTabbed}" >
> > <tr:showDetailItem text="testTab">
> > <tr:outputText value="testText"></tr:outputText>
> > </tr:showDetailItem>
> > </tr:panelTabbed>
> > -------------
> >
> >
> > 1 child:
> > -------------
> > <tr:panelTabbed position="both" >
> > <tr:showDetailItem text="testTab">
> > <tr:outputText value="testText"></tr:outputText>
> > </tr:showDetailItem>
> > </tr:panelTabbed>
> > -------------
> >
> >
>
>
>