You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by José Manuel García Alonso <jg...@unex.es> on 2008/04/28 12:15:00 UTC

[Trinidad] Use tr:iterator var in JSTL tag

Hi
 
I'm trying to do something like that
 
<tr:iterator value="#{projects}" var="project">
    <c:choose>
        <c:when test="${project.foo()}">
        </c:when>
    </c:choose>
</tr:iterator>
 
But I can't access to project var from JSTL tags. Somebody knows a way to access this var from JSTL tags?
 
Thanks

Re: [Trinidad] Use tr:iterator var in JSTL tag

Posted by "simon.kitching@chello.at" <si...@chello.at>.
José Manuel García Alonso schrieb:
> Hi
>  
> I'm trying to do something like that
>  
> <tr:iterator value="#{projects}" var="project">
>     <c:choose>
>         <c:when test="${project.foo()}">
>         </c:when>
>     </c:choose>
> </tr:iterator>
>  
> But I can't access to project var from JSTL tags. Somebody knows a way
> to access this var from JSTL tags?

You can't.

In JSF, *first* a component tree is built, *then* the component tree is
rendered. JSP/JSTL tags run during the "build" phase, but  tr:iterator
executes its contents during the "render" phase.

In general, you should avoid c:if and c:choose completely when writing
JSF applications. Use the JSF "rendered" attribute available on each
component instead.

See here for a general overview of JSF:
  http://wiki.apache.org/myfaces/JSF_and_MVC

Regards,
Simon


RE: [Trinidad] Use tr:iterator var in JSTL tag

Posted by José Manuel García Alonso <jg...@unex.es>.
Thank you Andrew and thank you simon too, very useful information wich I unknow

________________________________

De: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
Enviado el: lun 28/04/2008 18:04
Para: MyFaces Discussion
Asunto: Re: [Trinidad] Use tr:iterator var in JSTL tag



See:
http://andrewfacelets.blogspot.com/2008/03/build-time-vs-render-time.html




Re: [Trinidad] Use tr:iterator var in JSTL tag

Posted by Andrew Robinson <an...@gmail.com>.
See:
http://andrewfacelets.blogspot.com/2008/03/build-time-vs-render-time.html

On Mon, Apr 28, 2008 at 4:15 AM, José Manuel García Alonso
<jg...@unex.es> wrote:
>
> Hi
>
> I'm trying to do something like that
>
> <tr:iterator value="#{projects}" var="project">
>     <c:choose>
>         <c:when test="${project.foo()}">
>         </c:when>
>     </c:choose>
> </tr:iterator>
>
> But I can't access to project var from JSTL tags. Somebody knows a way to
> access this var from JSTL tags?
>
> Thanks