6 Replies Latest reply on Aug 31, 2009 11:26 AM by Sascha Janz

    trouble with a4j:include

    Sascha Janz Master

      i try to integrate a page via a4j:include. but when i do that the a4j:commandbutton doesn't work any more.

      first the page is

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j">
      <a4j:form>
       <h:outputLabel value="Funktionsstatistik" style="font-size:21px" />
       <br/>
       <a4j:log level="ALL" popup="false" />
       <a4j:commandButton action="#{Profiler.clear}" status="globalStatus" bypassUpdates="true" immediate="true" value="Zurücksetzen" reRender="profiletable,counter" ></a4j:commandButton>
       <a4j:region id="profileregion">
       <h:outputText value="#{Profiler.count}" id="counter" />
       <rich:extendedDataTable value="#{Profiler.profiledata}" var="data" id="profiletable"
       onRowMouseOver="this.style.backgroundColor='#FFFF99'" rows="0"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       cellpadding="0" cellspacing="0"
       width="100%" border="0">
      
       <rich:column sortBy="#{data.name}" style="text-align:left;" label="Name" width="200px" >
       <f:facet name="header" >
       <h:outputText value="Funktion" />
       </f:facet>
       <h:outputText value="#{data.name}" />
       </rich:column>
       <rich:column sortBy="#{data.count}" style="text-align:left;" label="Anzahl" >
       <f:facet name="header" >
       <h:outputText value="Anzahl" />
       </f:facet>
       <h:outputText value="#{data.count}" />
       </rich:column>
       <rich:column sortBy="#{data.avg}" style="text-align:left;" label="Durchschnitt" >
       <f:facet name="header" >
       <h:outputText value="Durchschnitt" />
      
       </f:facet>
       <h:outputText value="#{data.avg}" >
       <f:convertNumber minFractionDigits="3"/>
       </h:outputText>
      
       </rich:column>
      
       <rich:column sortBy="#{data.min}" style="text-align:left;" label="Minimum" >
       <f:facet name="header" >
       <h:outputText value="Minimum" />
       </f:facet>
       <h:outputText value="#{data.min}" >
       <f:convertNumber minFractionDigits="3"/>
       </h:outputText>
      
       </rich:column>
       <rich:column sortBy="#{data.max}" style="text-align:left;" label="Maximum" >
       <f:facet name="header" >
       <h:outputText value="Maximum" />
       </f:facet>
       <h:outputText value="#{data.max}" >
       <f:convertNumber minFractionDigits="3"/>
       </h:outputText>
      
       </rich:column>
      
       <rich:column sortBy="#{data.total}" style="text-align:left;" label="Gesamt" >
       <f:facet name="header" >
       <h:outputText value="Gesamt" />
       </f:facet>
       <h:outputText value="#{data.total}" >
       <f:convertNumber minFractionDigits="3"/>
       </h:outputText>
      
       </rich:column>
      
       </rich:extendedDataTable>
      </a4j:region>
      
      </a4j:form>
      </ui:composition>
      



      so i removed the a4j:form and set on my page

       <a4j:form >
      
       <a4j:include viewId="#{AdminClient.page}" />
       </a4j:form>
      
      


      but then the commandbutton doesn't work any more. what am i doing wrong?



        • 1. Re: trouble with a4j:include
          Sascha Janz Master

          tested include like this

          <?xml version="1.0" encoding="ISO-8859-1"?>
          <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:rich="http://richfaces.org/rich"
           xmlns:a4j="http://richfaces.org/a4j" template="../layout/template.xhtml">
           <ui:define name="body">
           <a4j:form >
          
           <a4j:include viewId="../admin/profile.xhtml" />
           </a4j:form>
           </ui:define>
           </ui:composition>
          


          it works


          but like this it doens't...why?

          <?xml version="1.0" encoding="ISO-8859-15"?>
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html 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:rich="http://richfaces.org/rich"
           xmlns:a4j="http://richfaces.org/a4j"
           xmlns:s="http://jboss.com/products/seam/taglib">
          <head>
          <style type="text/css">
           .top { vertical-align:top;border:1px; }
          </style>
          <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
          </head>
           <ui:composition template="/layout/template.xhtml">
           <ui:define name="body">
          
           <rich:panel header="Administration" >
           <rich:messages></rich:messages>
          
           <table style="width:1200px" >
           <tr>
           <td valign="top" width="350px">
           <a4j:form>
           <rich:tree style="width:300px;height:100%;border:1px" id="admintree" styleClass="top" nodeSelectListener="#{AdminTree.processSelection}"
          
           ajaxSubmitSelection="true" nodeFace="#{item.type}" reRender="adminpage"
           value="#{AdminTree.treeNode}" var="item">
           <rich:treeNode type="ordner" >
           <h:outputText value="#{item.text}" style="font-size:10px" >
           <rich:toolTip value="#{item.text}"></rich:toolTip></h:outputText>
           </rich:treeNode>
           </rich:tree>
           </a4j:form>
          </td>
          <td>
          
           <h:panelGroup id="adminpage" style="width:800px" >
           <a4j:form >
           <a4j:include viewId="#{AdminClient.page}" />
           </a4j:form>
           </h:panelGroup>
          
           </td>
           </tr>
           </table>
          
           </rich:panel>
          
          
          
          </ui:define>
          
          </ui:composition>
          </html>


          • 2. Re: trouble with a4j:include
            Nick Belaevski Master

            Hi,

            Are there any errors in a4j:log?

            • 3. Re: trouble with a4j:include
              Sascha Janz Master

              unfortunately not....

              but when i remove the first a4j:form it works.....

              are there any restrictions with multiple a4j:forms?

              • 4. Re: trouble with a4j:include
                Sascha Janz Master

                sorry must correct me.

                if i include the page fixed with

                <a4j:form >
                <a4j:include viewId="/admin/profile.xhtml" />
                </a4j:form>

                it works.

                not not via binding like this

                <a4j:include viewId="#{AdminClient.page}" />


                • 5. Re: trouble with a4j:include
                  Ilya Shaikovsky Master

                  maybe binding contains of not correct relative path?

                  • 6. Re: trouble with a4j:include
                    Sascha Janz Master

                    no...that i checked first...it's exactly "/admin/profile.xhtml"