fix o:moveComponent "WARNING Unable to save dynamic action" #224

Closed
wants to merge 1 commit into
from

Projects

None yet

1 participant

@mmariotti
Contributor

Hello guys,

I'm experimenting with o:moveComponent and nested forms:

<h:form id="form">
    <p:inputText id="outerText" value="#{viewScope.text}" />

    <p:commandButton id="openButton" process="@form" update="@widgetVar(testDialog)"
        oncomplete="PF('testDialog').show()" value="open" />

    <o:moveComponent id="move" for=":#{facesContext.viewRoot.clientId}" destination="ADD_LAST">
        <h:form id="innerForm">
            <p:dialog id="dialog" widgetVar="testDialog" header="test dialog">
                <p:inputText id="innerText" value="#{viewScope.text}" />

                <f:facet name="footer">
                    <p:commandButton id="confirmButton" process="@form" update=":form"
                        oncomplete="if(!args.validationFailed) PF('testDialog').hide()" value="submit" />
                </f:facet>
            </p:dialog>
        </h:form>
    </o:moveComponent>
</h:form>

I'm using o:moveComponent to "extract" the inner form and place it under h:body/viewRoot, rather "inserting" it elsewhere.

This is working fine, but produces some warning:

WARNING Unable to save dynamic action with clientId 'form:innerForm:dialog' because the UIComponent cannot be found
WARNING Unable to save dynamic action with clientId 'form:innerForm:innerText' because the UIComponent cannot be found
WARNING Unable to save dynamic action with clientId 'form:innerForm:confirmButton' because the UIComponent cannot be found

on subsequent RESTORE_VIEW for postback.

However I found it's possible to eliminate these warnings removing restored children on PostAddToView.

I haven't tested if this can have side effects while moving facets or behaviors, but it's working fine with just components.

Tested with Wildfly 10.0.0.Final (jsf-impl-2.2.12-jbossorg-2)

@BalusC BalusC added a commit that closed this pull request Jul 15, 2016
@BalusC BalusC Fix #224: bypass Mojarra warning "Unable to save dynamic action"
Just explicitly perform move on PostAddToViewEvent for all cases.
9298c79
@BalusC BalusC closed this in 9298c79 Jul 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment