Skip to content

Conversation

mmariotti
Copy link
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 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant