3 Replies Latest reply on Oct 17, 2011 1:04 PM by Christian Peter

    popup whith a4j:param

    lionel nirthalo Newbie

      Hello,

        I try to communicate information from pop up panel to bean.

      I propose a list to users and take in my bean the seleted item to complete information in parent page.

      I use demo page to show you the code I write, If I clic link in my pop up panel there is nothing but on firebug I have  an error : Sourceform could not be determined, either because element is not attached to a form or we have multiple forms with named elements of the same identifier or name, stopping the ajax processing

       

       

        • 1. Re: popup whith a4j:param
          lionel nirthalo Newbie

          the code :

          <ui:composition template="/templates/template_a.xhtml"

              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:a4j="http://richfaces.org/a4j"

              xmlns:rich="http://richfaces.org/rich">

           

          <ui:define name="main">

              <h:form>

              <h:commandButton value="Call the popup">

                  <rich:componentControl target="popup" operation="show" />

              </h:commandButton>

              </h:form>

             

              <h:form>

              <rich:popupPanel id="popup" modal="true" resizeable="true"

                  onmaskclick="#{rich:component('popup')}.hide()">

                  <f:facet name="header">

                      <h:outputText value="Simple popup panel" />

                  </f:facet>

                  <f:facet name="controls">

                      <h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;">X </h:outputLink>

                  </f:facet>

                  <p>You can also check and trigger events if the use clicks outside of the

                  panel.</p>

                  <p>In this example clicking outside closes the panel.</p>

                  <a4j:commandLink render="societe1"  >

                        <a4j:param name="soc2" value="ha ha ha" assignTo="#{personneBean.message}"/>

                        <h:outputText value="HA2" />       

                  </a4j:commandLink>

              </rich:popupPanel>

              </h:form>

          </ui:define>

          </ui:composition>

           

           

          thanks for help

          • 2. Re: popup whith a4j:param
            lionel nirthalo Newbie

            if I copy the link in the main form it's work my bean receive message en print it.

            <h:form id="top">

                <h:commandButton value="Call the popup">

                    <rich:componentControl target="popup" operation="show" />

                </h:commandButton>

                <a4j:commandLink id="bouton0" render="societe1"  >

                          <a4j:param name="soc2" value="ha ha ha" assignTo="#{personneBean.message}"/>

                          <h:outputText value="HA2" />       

                    </a4j:commandLink>

                </h:form>

             

            I don't understand why this link don't work in popup.

            • 3. Re: popup whith a4j:param
              Christian Peter Expert

              You should place the h:form tag inside your popup panel. I haven't used richfaces 4 before, but in rf 3.3.x the modal panel will be moved in the DOM and will be outside your form.