Hello,

I use Woody as form manager.
In one form definition file, I have a multivaluefield initialized from a
postgresql table :

----------
<wd:multivaluefield id="domaine">
     <wd:label></wd:label>
     <wd:datatype base="string">
         <wd:validation>
           <wd:value-count min="1"/>
         </wd:validation>
    </wd:datatype>
    <wd:selection-list src="cocoon://selectionDomaine" dynamic="false"/>
</wd:multivaluefield>
----------

The query is carried out in the domaine_select.sxp file :

----------
<?xml version="1.0" encoding="iso-8859-1"?>

<xsp:page language="java"
   xmlns:xsp="http://apache.org/xsp";
   xmlns:xsp-request="http://apache.org/xsp/request/2.0";
   xmlns:esql="http://apache.org/cocoon/SQL/v2";
   xmlns:wt="http://apache.org/cocoon/woody/template/1.0";
   xmlns:wi="http://apache.org/cocoon/woody/instance/1.0";
   xmlns:xsp-cookie="http://apache.org/xsp/cookie/2.0";


<xsp:structure> <xsp:include>java.util.*</xsp:include> <xsp:include>java.text.DateFormat</xsp:include> <xsp:include>org.apache.cocoon.environment.Cookie</xsp:include> </xsp:structure>

<wd:selection-list xmlns:wd="http://apache.org/cocoon/woody/definition/1.0";>
<xsp:logic>
  String langue                    = new String("fr");
  Cookie cookielangue            = <xsp-cookie:getCookie name="langue"/>;
  if (cookielangue != null) {
     langue                             = cookielangue.getValue();
   }
</xsp:logic>
  <esql:connection>
        <esql:pool>maPool</esql:pool>
<xsp:logic>
       if (langue.compareTo("fr")==0) {
</xsp:logic>
            <esql:execute-query>
                <esql:query><xsp:expr>"SELECT id,intitule FROM
domaineexpertise WHERE lang_id='fr' ORDER BY id"</xsp:expr>
                             </esql:query>


<esql:results> <esql:row-results> <wd:item><xsp:attribute name="value"><esql:get-string column = "id"/></xsp:attribute> <wd:label><esql:get-string column="intitule"/></wd:label> </wd:item> </esql:row-results> </esql:results>

           </esql:execute-query>
<xsp:logic>
         }
         else {
</xsp:logic>
               <esql:execute-query>
                <esql:query><xsp:expr>"SELECT id,intitule FROM
domaineexpertise WHERE lang_id='en' ORDER BY id"</xsp:expr>
                             </esql:query>


<esql:results> <esql:row-results> <wd:item><xsp:attribute name="value"><esql:get-string column = "id"/></xsp:attribute> <wd:label><esql:get-string column="intitule"/></wd:label> </wd:item> </esql:row-results> </esql:results>

           </esql:execute-query>
<xsp:logic>
         }
</xsp:logic>
 </esql:connection>

</wd:selection-list>
</xsp:page>
----------

In this query, my selection is sorted by the field "id" which is sequential.
But when my form is displayed, the values corresponding to the field
"intitule" (wd:label)  are sorted alphabetically (ignoring my "id" query
sorting criteria).
I guess it comes form a javascript but I can not figure out where it is
done.

Does someone know how I could fix this ?

Thanks.
Anthony Herv�


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to