2 Replies Latest reply on Jul 9, 2013 3:05 AM by mbickel

    Is popupPanel domElementAttachment="form|parent" supported in a composite component?

    mbickel

      I've got a strange problem I hope someone can help me with: I have a composite component like this:

       

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:ui="http://java.sun.com/jsf/facelets"
                      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                      xmlns:rich="http://richfaces.org/rich"
                      xmlns:a="http://richfaces.org/a4j"
                      xmlns:tic="http://java.sun.com/jsf/composite/ticlib"
                      xmlns:cc="http://java.sun.com/jsf/composite">
          <cc:interface>
              <cc:attribute name="value" type="com.mycompany.entity.Task" required="true" />
          </cc:interface>
        
          <cc:implementation>
              <rich:popupPanel id="modal" minWidth="380" minHeight="350" autosized="true" domElementAttachment="parent">
      
                <rich:autocomplete id="calTalent" autocompleteMethod="#{suggestor.doIt}"
                                             inputClass="w200"
                                             value="#{managerBean.property}" var="tal" converter="#{myconverter}"
                                             fetchValue="#{tal.person.fullname}"
                                             rendered="#{empty cc.attrs.value.id}">
                          <h:outputText value="#{tal.person.fullname}" />
                 </rich:autocomplete>
               </rich:popupPanel>
          </cc:implementation>
      </ui:composition>
      

       

      I've included this component in a <h:form> like so:

       

      <h:form id="taskForm">
           <rich:tabPanel>
             <rich:tab>
               //more jsf components
               <a4j:jsFunction name="renderTask" action="#{managerBean.selectTask}" render="taskEditor:modal" oncomplete="#{rich:component('taskEditor:modal')}.show();" />
             </rich:tab>
           </rich:tabPanel>
           <tic:taskEditor id="taskEditor" value="#{managerBean.currentTask}" />
      </h:form>
      

       

      However, what actually gets output to the HTML tree is:

       

      <form id="taskForm">
       <!-- the tabPanel i created and which re-renders the composite component's modal panel -->
      </form>
      <div id="taskForm:taskEditor:modal" style="display:block;">
        <!-- the popup -->
      </div>
      

       

      Notice how JSF gets that the popup is to go in the taskForm, but something moves it out of it. This causes all form elements to be ignored in the submit (I end up with no suggest search input in my autocompleteMethod in this case).

      With domElementAttachment="form" it's even worse and the popup gets attached to body.

       

      Is this is a known bug in RF-4.3.2 or is my usage faulty somehow?

       

      P.S.: Can you please, please switch to some sane editor for code markup? It's driving me nuts.