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 Adam Winer <aw...@gmail.com> on 2006/09/15 16:58:43 UTC

Re: ClassCastException

In Facelets, you don't use tr:forEach, just c:forEach.  Whereas in JSP 2.0,
you can't use c:forEach at all.  But in JSP 2.1, back to c:forEach.

Simple, huh? ;)

-- Adam


On 8/29/06, Günther, Thorsten <Th...@medocino.de> wrote:
>
> Hi Arnaud!
>
> Thanks for your suggestion. I remember to have read about tr:forEach and
> tr:iterator being rendered at different stages in the page build process.
> I'll have to get a deeper understanding of this.
>
> For me using tr:forEach is not an option since it is not supported by
> Facelets.
>
> Regards,
> Thorsten
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Arnaud MERGEY [mailto:amergey@sunopsis.com]
> Gesendet: Dienstag, 29. August 2006 08:39
> An: adffaces-dev@incubator.apache.org
> Betreff: Re: ClassCastException
>
> 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>
> >> > > > > > -------------
> >> > > > > >
> >> > > > > >
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > >
> >> > > >
> >> > >
> >> > >
> >> >
> >>
> >
>
>
>