You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ayana joseph <jo...@hotmail.com> on 2004/10/20 13:34:01 UTC

HELP WITH FORM DISPLAY

Hi, I am a Masters student from the University of the West Indies in 
Trinidad and I am using cocoon 2.1.3 for my thesis project to design some 
forms using woody and flowscript.

When I call the pipeline to display a particular form, I get the 
confirmation page or the success page instead of the form being displayed. 
Can anyone tell me what I am doing wrong? Here is a sample of the code 
below:

The SITEMAP :

<map:pipeline>
  <map:match pattern="playerRegistration">
        <map:call function="playerRegistration"/>
       </map:match>

<map:match pattern="*.continue">
       <map:call continuation="{1}"/>
     </map:match>

     <map:match pattern="player-registration-display-pipeline">
       <map:generate src="forms/player_registration_template.xml"/>
       <map:transform type="woody"/>
       <map:transform type="i18n">
         <map:parameter name="locale" value="en-US"/>
       </map:transform>
       <map:transform 
src="context://samples/common/style/xsl/html/simple-page2html.xsl">
         <map:parameter name="contextPath" value="{request:contextPath}"/>
         <map:parameter name="servletPath" value="{request:servletPath}"/>
         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
         <map:parameter name="file" 
value="forms/player_registration_template.xml"/>
         <map:parameter name="remove" value="{0}"/>
       </map:transform>
       <map:transform src="resources/woody-samples-styling.xsl"/>
         <map:serialize/>
       </map:match>

      <map:match pattern="player-registration-success-pipeline">
       <map:generate type="jx" src="forms/player_registration_success.jx"/>
       <map:transform 
src="context://samples/common/style/xsl/html/simple-page2html.xsl">
         <map:parameter name="contextPath" value="{request:contextPath}"/>
         <map:parameter name="servletPath" value="{request:servletPath}"/>
         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
         <map:parameter name="file" 
value="forms/player_registration_success.jx"/>
     <map:parameter name="remove" value="{0}"/>
       </map:transform>
       <map:serialize/>
     </map:match>
   </map:pipeline>

The FLOWSCRIPT:

function playerRegistration()
{
   form = new Form("forms/playerRegistration.xml");

  try
   {

  ///////connecting to DB///////

  dbSelector = 
cocoon.getComponent(Packages.org.apache.avalon.excalibur.datasource.DataSourceComponent.ROLE 
  + "Selector");
       var dataSrc = dbSelector.select("mysql-pool");
       conn = dataSrc.getConnection();

   ///////connecting to DB///////

  //////executing query//////

  var query = "select name from team ;";
  var stmt = conn.createStatement();
  stmt.execute(query);
  var rs = stmt.getResultSet();

//////executing query//////

  var list1 = buildSelectionList(rs);// puts result from database into an 
array
var tList = form.getWidget("team");
  tList.setSelectionList(list1,"key","value");
  form.showForm("player-registration-display-pipeline");
}catch(e){e.toString();}
cocoon.sendPage("player-registration-success-pipeline");
}

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org