Yes but I don“t know if is the JSF version I'm using or something else
because I get a compilation error that says:
"Error(461): f:setPropertyActionListener no es una etiqueta registrada en
ese espacio de nombres."
*In english: "Error(461): f:setPropertyActionListener is not a registered
tag in that namespace"*
Thanks
I also try:
1-
JSP:
<h:commandButton value="seleccionar"
actionListener="#{VDBean.seleccionar}" id="seleccionarLink">
* <f:param name="foo" value="true"/>*
</h:commandButton>
BB:
* Map<String,String> params =
context.getExternalContext().getRequestParameterMap();
String action = params.get("foo");*
System.out.println("test1: " +foo);---->* Null*
2-
JSP:
<h:commandButton value="seleccionar"
actionListener="#{VDBean.seleccionar}" id="seleccionarLink">
* <f:attribute name="foo" value="true" /> *
</h:commandButton>
BB:
* action =
(String)actionEvent.getComponent().getAttributes().get("foo");*
System.out.println("test2: " + foo);----> *Null*
3-
JSP:
<h:commandButton value="seleccionar"
actionListener="#{VDBean.seleccionar}" id="seleccionarLink">
*<a4j:actionparam assignTo="#{VDBean.foo}" value="true"
id="foo" />
* </h:commandButton>
BB:
System.out.println("test3: " + this.foo);---->* false (the initial
value)*
Please help! I only need to pass a parameter when a button is clicked to the
backingbean, but something so simple in teory is not working!
On Thu, Mar 10, 2011 at 9:27 AM, Mike Kienenberger <mkienenb@gmail.com>wrote:
> I doubt it matters whether you are using tomahawk or richfaces or
> something else.
>
> Have you tried <f:setPropertyActionListener target="#{VDBean.foo}"
> value="true" /> yet?
>
> On Thu, Mar 10, 2011 at 8:05 AM, daniel ccss <danielccss2@gmail.com>
> wrote:
> > Anyone?
> >
> >
> > On Wed, Mar 9, 2011 at 5:06 PM, daniel ccss <danielccss2@gmail.com>
> wrote:
> >>
> >> Thanks Myke but I'm using myfaces tomahawk, not richfaces.
> >>
> >> I also tried a more simple code:
> >>
> >> In the JSP:
> >>
> >> <h:commandButton value="seleccionar"
> >> actionListener="#{VisitaDomiciliarBean.seleccionar}"
> id="seleccionarLink"
> >> style="display:none">
> >> <f:param name="booleanActividad"
> >> value="true"/>
> >> </h:commandButton>
> >>
> >> In the BackingBean:
> >>
> >> FacesContext context = FacesContext.getCurrentInstance();
> >> String paramVaule =
> >>
> >>
> (String)context.getExternalContext().getRequestParameterMap().get("booleanActividad");
> >>
> >> System.out.println(paramVaule);-----> null
> >>
> >>
> >>
> >> But it returns null, what I'm missing?
> >
> >
>
|