4 Replies Latest reply on Oct 2, 2007 3:40 AM by ahmed Moh'

    client.submit() issue

    ahmed Moh' Newbie

      I am trying to click a command button like this:
      client.submit("commandlinkButtonID");

      Note : that command button is in a sub view which doesn't contain a form the form is in the view which contains the sub view.


      and that coze the exception with the following stack trace :
      //-------------------
      org.jboss.jsfunit.facade.FormNotFoundException: No form was found containing component ID nav:commandButtonId
      at org.jboss.jsfunit.facade.JSFClientSession.getForm(JSFClientSession.java:156)
      at org.jboss.jsfunit.facade.JSFClientSession.submit(JSFClientSession.java:276)
      at com.itex.test.JSFUnitTest.testOpen(JSFUnitTest.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
      at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
      at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
      at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:217)
      at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
      at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
      at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:217)
      at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
      at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
      at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:217)
      at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:88)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
      at java.lang.Thread.run(Unknown Source)
      //--------------------

      the sub view jsp code:

      
       <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
       <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      
       <f:subview id="nav">
      <h:commandButton id="commandButtonId" actionListener="#{viewState.changeView}" action="ref" >
       </h:commandButton>
      
      ... more command buttons
      
       </f:subview>
      


      the view jsp page code:
      
       <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
       <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
       <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
       <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      
      
      
      
      
      
      <html>
      <head>
      
      
       <link rel="stylesheet" type="text/css" href="../css/cims.css" />
       <link rel="icon" href="../images/itex_logo.jpg" type="image/jpg" />
      
      </head>
      <f:view locale="#{localeChanger.selectedLocale}">
      
       <f:loadBundle basename="messages" var="msgs"/>
      
       <h:form id="form" prependId="false">
      
      
       <table align="center" width="100%" height="100%" cellpadding="0" cellspacing="0" >
       <tr valign="top">
       <td colspan="3" dir="ltr" valign="top" >
       <c:import url="header.jsp"/>
       </td>
       </tr>
      
       <tr height="1%">
       <td colspan="2">
      
       </td>
       </tr>
      
       <tr valign="top" height="83%">
       <td valign="top" align="left" width="8%">
       <jsp:include page="nav.jspe"/>
       </td>
      
      
       <td valign="top" width="91%" colspan="2" >
      
       <f:subview id = "viewstate">
       <c:import url="content.jspe"/>
       </f:subview>
      
       </td>
       </tr>
      
       <tr valign="bottom">
       <td>
      
       </td>
      
       <td>
      
       </td>
      
       <td class="style2" valign="bottom" > width="30%" height="*">
       <img src="../images/logo.jpg"/>
       </td>
      
       </tr>
      
       </table>
      
      </h:form>
      
      
      </f:view>
      </html>