Question

I want pass a URL parameter to a JSF backing bean within a remote Command.

If I print, in the page, #{param.id} with a <h:outputLabel> it works.
If I pass it to a backing bean and print it in a method's bean I get null also if passing only {param} I the reference to the parameter. In other if I pass a static value it works.

Page.xhtml:

<h:form>
    <p:remoteCommand name="rmtinit" autoRun="true" immediate="true"
        action="#{confirmbean.setta}" async="false">
            <f:setPropertyActionListener target="#{confirmbean.id}" value="#{param.id}" />
            <f:setPropertyActionListener target="#{confirmbean.idStatic}" value="900099" />
    </p:remoteCommand>
</h:form>
Was it helpful?

Solution

Remove immediate attribute and try again.

Default immediate value is false.

Value of immediate attribute that determines the phaseId of the action event, when true actions are processed at "Apply Request Values", when false at "Invoke Application" phase.

OTHER TIPS

mstzn said me: "Remove immediate attribute and try again". I've removed that attribute and it works.

Remove immediate attribute and try again. – mstzn yesterday

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top