myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Accessing JSP action var attribute from normal JSP expression or action
Date Fri, 22 Sep 2006 08:44:02 GMT
On 8/23/06, Daniel Kröger <dakr@cinetic21.de> wrote:
> I'm a bit confused since the description of the var attribute for the
> dataTable action says it's the request scope variable that holds the
> current row object.
>
> But the following exemplary code doesn't work anyway:
>
> <h:dataTable value="#{children}" var="child">
>    <h:column>
>      <h:outputText value="#{child.name}"/>
>      <f:verbatim>${child.name}</f:verbatim>
>    </h:column>
> </h:dataTable>
>
> So is there any other way to access the current var attribute from a
> normal JSP expression or action?

<h:outputText value="#{child.name}"/> will work.  If it's not working,
it's probably because #{children} is wrong or empty.  Generally, it''s
#{bean.list} so what you have there looks a little odd.

<f:verbatim>${child.name}</f:verbatim> will not work.   $ searches the
jsp scope, not the JSF scope.   I think this scope is only used when
the page is compiled, but I don't use JSP.

Mime
View raw message