cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "magic" <ma...@goodwillheater.com>
Subject Re: Problems creating a drop down selection box
Date Mon, 18 Apr 2005 01:03:04 GMT
Re: Problems creating a drop down selection boxIN Cform:
    <fd:selection-list dynamic="true" src="cocoon:/xsp/esql"/>
IN XSP:
<?xml version="1.0"?>
<xsp:page language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:esql="http://apache.org/cocoon/SQL/v2">
  <page>
   <esql:connection>
     <esql:pool>shb</esql:pool>
       <esql:execute-query>
         <esql:query>select cldh, clmc from shclj1 where cldh like 'YBZ%'</esql:query>
         <esql:results>
            <esql:row-results>
              <content>
                    <id>
                         <esql:get-string column="shclj1_cldh"/>
                    </id>
                    <name>
         <esql:get-string column="shclj1_clmc"/>
                    </name>
               </content>
            </esql:row-results>
         </esql:results>
       </esql:execute-query>
      </esql:connection>
  </page>
</xsp:page>
IN sql2xml.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
  <xsl:template match="page">
 <fd:selection-list xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
  <xsl:element name="fd:item"/>
  <xsl:for-each select="content">
   <xsl:element name="fd:item">
    <xsl:attribute name="value"><xsl:value-of select = "id"/></xsl:attribute>
    <xsl:element name="fd:label">
       <xsl:value-of select = "name"/>
    </xsl:element>
   </xsl:element>
  </xsl:for-each>
 </fd:selection-list>
  </xsl:template>
</xsl:stylesheet>
  ----- Original Message ----- 
  From: beyanet.com 
  To: users@cocoon.apache.org 
  Sent: Saturday, April 16, 2005 3:50 PM
  Subject: Re: Problems creating a drop down selection box


    I tested.Your code does not work in V2, so you should check if you use V2 first.I think
esql maybe work.


  Hi Magic,
  I am currently using version 2.1.7. I know the code doesn't work ;-) Could you show me some
example code which will work?


  many thanks


  Uzo
Mime
View raw message