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>
有帮助吗?

解决方案

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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top