문제

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