2 Replies Latest reply on Sep 12, 2008 8:27 AM by nemojdamesmaras

    Two a4j:commandButton in different forms exclude each other

    nemojdamesmaras

      Hi,

      I have two pages (with two different forms) that I'm loading via AJAX. On those pages I have one a4j:commandButton which are calling some backing bean method.

      Scenario:

      1) Index page is loaded
      2) First page with A4J button is loaded via ajax (in first div, on richpanel item click) - everything works fine
      3) Second page with another A4J button is loaded via ajax (in second div, also on richpanel item click) - button in this page works fine, but button in first page isn't calling it's backing bean method!

      Backing bean method is really simple, only one System.out.println.
      JSP page is also really simple, just A4J button tag.

      I'm using Richfaces 3.20SR1
      Is this some bug or I'm doing something wrong.

      Thanks!
      Goran

        • 1. Re: Two a4j:commandButton in different forms exclude each ot
          ilya_shaikovsky

          Please add actual page snippets. Also add rich:messages to your pages.

          B.t.w. latest stable version is 3.2.2 GA

          • 2. Re: Two a4j:commandButton in different forms exclude each ot
            nemojdamesmaras

            This is first page:

            <jsp:root version="2.1" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
             <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
             <f:view>
             <webuijsf:form id="pageform1">
             <a4j:commandButton action="#{Page1.test}" id="button1" style="position:fixed; top:164px; left:154px; width:100px; height:25px" value="Debug">
             <a4j:actionparam name="idKl" noEscape="true" value="test()" />
             </a4j:commandButton>
             </webuijsf:form>
             </f:view>
            </jsp:root>


            Second page:
            <jsp:root version="2.1" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
             <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
             <f:view>
             <webuijsf:form id="pageform2">
             <a4j:commandButton action="#{Page2.testUpisa}" id="button2" style="position:fixed; top:164px; left:154px; width:100px; height:25px" value="Debug">
             <a4j:actionparam name="idKl" noEscape="true" value="test()" />
             </a4j:commandButton>
             </webuijsf:form>
             </f:view>
            </jsp:root>
            


            They are loaded in this third page via ajax.updater in div with class dhtmlgoodies_aTab:

             <h:form id="form1">
             <webuijsf:hiddenField id="pocetniTab" text="#{Glavni.pocetniTabText}"/>
             <div id="dhtmlgoodies_tabView1" style="position: fixed; left: 0px; top: 0px;">
             <div class="dhtmlgoodies_aTab">
             </div>
             </div>
             </h:form>
            



            P.S. Tried with RF 3.2.2, same thing :(