سؤال

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