cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Delort" <Stephane.Del...@edag.de>
Subject Re: [Cforms] fd:action in struc, class or union special issue
Date Mon, 16 Aug 2004 07:51:14 GMT


Hi everyone,


I made some test about the behaviour of the action widget in union, class
and struct.
It appears that when is an action widget is included in an union, it
becomes a submit (while it shouldn't).

In this is ONLY WITH UNIONS, not with classes nor struct. (I made a mistake
last time)

Please, can anyone involved with this kind of widget confirm this.



Here is the code I tried :   (quite simple I guess)



Definition file:


<?xml version="1.0"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
         xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
  <fd:widgets>

        <fd:field id="type">

          <fd:label>Widget Type</fd:label>

         <fd:datatype base="string"/>

          <fd:selection-list>

            <fd:item value="action-in-union"></fd:item>

            <fd:item value=""></fd:item>

         </fd:selection-list>

      </fd:field>

 <fd:union id="start" case="type">
      <fd:datatype base="string"/>
      <fd:widgets>
        <fd:action  id="action-in-union"  action-command="...">
          <fd:label>action in union</fd:label>
          <fd:on-action>
            <javascript>
              java.lang.System.err.println("Action in a union");
            </javascript>
          </fd:on-action>
        </fd:action>
      </fd:widgets>
    </fd:union>
  </fd:widgets>
</fd:form>



Template file:


<?xml version="1.0"?>
<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
<page xmlns:ft="http://apache.org/cocoon/forms/1.0#template" xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
  <content>
    <ft:form-template action="project-selector2" method="POST">
      <ft:continuation-id/>
       <ft:union id="start">
        <ft:case id="action-in-union">
          <hr />
            <ft:widget id="in-union" />
          <hr />
        </ft:case>
        <ft:case id="">
          <h3> error at start </h3>
        </ft:case>
      </ft:union>
    </ft:form-template>
  </content>
</page>
</jx:template>





Related flowscript :

function test()
{
 var form = new Form("forms/test.xml" );
 form.lookupWidget("type").setValue("action-in-union");
 form.showForm("test-display-pipeline");
}





Thanks in advance,

Steph






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


Mime
View raw message