7 Replies Latest reply on Aug 9, 2007 9:46 AM by Ilya Shaikovsky

    Problem with a4j:status in subview...

    Michi hakan Newbie

      Hello!
      First at all I'd like to mention that I've got several pages where I used a4j:status in subregion without problems. I don't know why it doesn't work in my last created page...
      Well, here's the code of the "main"-page:

      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>
      
      <c:if test="${! LoginBean.serviceAllowed}">
      <jsp:forward page="login.jsf"></jsp:forward>
      </c:if>
      
      <html>
       <head>
       <title>Substrate- and Carriertype</title>
       <link rel="stylesheet" href="../stylesheets/stylesheet.css" type="text/css" />
       <script type="text/javascript" src="../javascript/common.js"></script>
       <script type="text/javascript">
       function clearArmInnerHTML() {
       document.getElementById('erroroutputinfo').innerHtml = "";
       }
       </script>
       </head>
       <body onload="checkIfError();">
       <f:view>
       <f:loadBundle basename="properties.service" var="msg"/>
       <h:form>
       <a4j:region>
       <h:selectOneMenu value="#{processBowlModuleService.selectedTab}">
       <f:selectItems value="#{processBowlModuleService.armItems}" />
       <a4j:support event="onchange" reRender="servicearmdata" status="genajaxloading" ajaxSingle="true"></a4j:support>
       </h:selectOneMenu>
      
       <h:panelGrid border="1" id="servicearmdata">
       <%
       com.ios.web.beans.ProcessBowlModuleService myBean = (com.ios.web.beans.ProcessBowlModuleService) session.getAttribute("processBowlModuleService");
      
       String includePage = "/include/servicearms/" + myBean.getArmIncludeName() + ".inc.jsp";
       %>
      
       <jsp:include page="<%= includePage %>" />
       </h:panelGrid>
      
       <jsp:include page="../include/genajaxloading.inc.jsp" />
       </a4j:region>
      
       <jsp:include page="../include/errorpanel.inc.jsp" />
       </h:form>
      
       <a4j:outputPanel id="erroroutputinfo" ajaxRendered="true">
       <h:inputHidden id="errorid" value="#{processBowlModuleService.state}" />
       <h:inputHidden id="errormsg" value="#{processBowlModuleService.errorMsg}" />
       </a4j:outputPanel>
       </f:view>
       </body>
      </html>
      


      As you can see, this page has a selectOneMenu where the user selects an item. When the user selects an item, a method from the bean is called and the area where the data (for the selected item) is displayed, gets reRendered (The included page depends on the selection from the user).
      In my sub-pages (the included ones), I have a subview and several a4j:regions and a a4j:status. When I remove the a4j:regions in the sub-page, the a4j:status works, but no actions are "executed" (from the a4j:commandButtons). With the a4j:region(s), the a4j:status doesn't work. But it's very important because I call several js-function at the "onstop"-command.
      Here's the code of one of the sub-pages:
      <f:subview id="motorxyzarmview">
      <f:loadBundle basename="properties.service" var="msg" />
       <a4j:region id="submainregion">
       <h:panelGrid id="motorxyzarmgrid" columns="2">
       <a4j:region id="region1057">
       <h:panelGrid id="positiongrid" columns="4">
       <h:outputText id="text6000" value="#{msg.xAxisLabel}:" />
       <h:outputText id="text6001" value="#{motorXYZArm.axisXStatus}" />
       <h:inputText id="it27c7" value="#{motorXYZArm.axisX}" />
       <a4j:commandButton id="gotoxbtn" value="#{msg.gotoLabel}" action="#{motorXYZArm.btnGoToX}" reRender="positiongrid" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       <h:outputText id="text6002" value="#{msg.yAxisLabel}" />
       <h:outputText id="text6003" value="#{motorXYZArm.axisYStatus}" />
       <h:inputText id="it20c7" value="#{motorXYZArm.axisY}" />
       <a4j:commandButton id="gotoybtn" value="#{msg.gotoLabel}" action="#{motorXYZArm.btnGoToY}" reRender="positiongrid" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       <h:outputText id="text6004" value="#{msg.zAxisLabel}" />
       <h:outputText id="text6005" value="#{motorXYZArm.axisZStatus}" />
       <h:inputText id="itjdk28" value="#{motorXYZArm.axisZ}" />
       <a4j:commandButton id="gotozbtn" value="#{msg.gotoLabel}" action="#{motorXYZArm.btnGoToZ}" reRender="positiongrid" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       <a4j:commandButton id="homebtn" value="#{msg.homeLabel}" action="#{motorXYZArm.btnHome}" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       <a4j:commandButton id="parkbtn" value="#{msg.parkpositionLabel}" action="#{motorXYZArm.btnPark}" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       <a4j:commandButton id="resetbtn" value="#{msg.resetLabel}" action="#{motorXYZArm.btnReset}" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       <a4j:commandButton id="stopbtn" value="#{msg.stopLabel}" action="#{motorXYZArm.btnStop}" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
       </h:panelGrid>
       </a4j:region>
      
       <a4j:region id="region10476">
       <h:panelGrid id="grid10fj" columns="3">
       <h:outputText id="text6006" value="#{msg.nozzleLabel}:" />
       <h:selectOneMenu id="som20572" value="#{motorXYZArm.selectedNozzle}">
       <f:selectItems id="sit28047" value="#{motorXYZArm.nozzleItems}"/>
       </h:selectOneMenu>
       <a4j:commandButton id="setpositionbtn" value="#{msg.setLabel}" action="#{motorXYZArm.btnGoToPosition}" reRender="positiongrid" disabled="#{!motorXYZArm.areaEnabled}"></a4j:commandButton>
      
       <h:outputText id="text6007" value="#{msg.relativeToLabel}:" />
       <h:selectOneMenu id="somdfd" value="#{motorXYZArm.selectedPositionTypeX}">
       <f:selectItems id="sitkd28" value="#{motorXYZArm.positionTypeComboItems}" />
       </h:selectOneMenu>
       <h:selectOneMenu id="somj17c" value="#{motorXYZArm.selectedPositionTypeY}">
       <f:selectItems id="sit28c" value="#{motorXYZArm.positionTypeComboItems}" />
       </h:selectOneMenu>
      
       <h:outputText id="text6008" value="#{msg.horizontalLabel}:" />
       <h:inputText id="itjc827" value="#{motorXYZArm.horizontalX}" />
       <h:inputText id="itck37" value="#{motorXYZArm.horizontalY}" />
      
       <h:outputText id="text6009" value="#{msg.speedLabel}:" />
       <h:inputText id="it28ck" value="#{motorXYZArm.speedX}" />
       <h:inputText id="itcc287" value="#{motorXYZArm.speedY}" />
      
       <h:outputText id="text6010" value="#{msg.verticalLabel}:" />
       <h:inputText id="it928c" value="#{motorXYZArm.vertical}" />
       </h:panelGrid>
       </a4j:region>
       </h:panelGrid>
      
       <jsp:include page="/include/genajaxloading.inc.jsp"/>
       </a4j:region>
      </f:subview>
      


      I can't find the problem. On other pages I do it the same way without problems... Any suggestions?
      Thanks in advance.