myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Korherr <jakob.korh...@gmail.com>
Subject Re: ui:param value accessible in backing bean?
Date Tue, 20 Jul 2010 21:20:28 GMT
Hi Michael,

You can use <c:set> from the JSTL to put the value into the request scope.
Then you can access it in the facelet and also later in the action method.

Namespace: xmlns:c="http://java.sun.com/jsp/jstl/core"

<c:set target="#{requestScope}" property="foo" value="fooValue" />

Regards,
Jakob

2010/7/20 Leonardo Uribe <lu4242@gmail.com>

> Hi
>
> I checked in deep some days ago ui:param, and it only define the expression
> when the view is build, but its context is not preserved on other phases.
> FaceletContext extends from ELContext and override its VariableMapper and
> FunctionMapper. So in practice, ui:param just add a variable on the
> variable
> mapper. but after ui:composition and ui:include ends its processing the
> variable is just discarded, because the whole VariableMapper wrapper
> created
> by this two tags is removed too.
>
> regards,
>
> Leonardo Uribe
>
> 2010/7/20 Michael Heinen <mhn4dev@googlemail.com>
>
> > Is it possible to access the value of a facelets ui:param tag in phase
> > render response in a backing bean?
> > I tried to resolve #{activeTab} in MyController.getOnlick() without
> > success.
> >
> > Sample:
> > 1) Template
> > <ui:composition template="templates/main.xhtml">
> > <ui:param name="activeTab" value="blabla"/>
> >
> > <ui:define name="navigation">
> > <ui:include src="/facelets/navigation.xhtml"></ui:include>
> > </ui:define>
> >
> >
> > 2) navigation.xhtml
> > ...
> > <t:commandLink onclick="#{MyController.onlick}"
> > ...
> >
> > I use myFaces 1.2.9 and facelets 1.1.15.
> >
> > Thanks,
> > Michael
> >
> >
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message