Florian Huonder
Florian Huonder

Reputation: 461

<f:setPropertyActionListener ... /> does not work

I have the following primefaces button on my jsf 2.1 page:

    <p:commandButton value="#{msg['button.halt']}" action="#{viewBean.haltTask}" ajax="false">
        <f:setPropertyActionListener target="#{myBean.disabled}" value="false" />
    </p:commandButton>

At another point in the application I read the value with

    ...
    <f:validateBean disabled="#{myBean.disabled}" />
    ...

Now the point is the reading works as expected, means the isDisabled() method is called on the myBean. The writing with the setPropertyActionListner does not work. The setter is never called. The myBean has Scope "request". Everything runs in a Servlet 3 container on Tomcat 7 with EL 2.2.x.

Does anybody have a hint what the error might be?

Best regards,

Florian

Upvotes: 4

Views: 8071

Answers (1)

Daniel
Daniel

Reputation: 37061

try to change the scope of the myBean to viewscope,

also take a look at BalusC answer in this thread f:setPropertyActionListener sets null value instead of intended value

Upvotes: 2

Related Questions