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: Re: [Cforms] fd:action in struc, class or union special issue
Date Mon, 16 Aug 2004 09:09:10 GMT

Re,

Well I identified my problem :

I have to put the list on which the union is bae on the template file with

<ft:widget id="type"/>


thus, I don't want to display this list to the user, that's why I did not
put it at first.
Then, now I have a nice selection list on my website which is NOT WANTED.

the union is here to answer a mapping serverside mapping need, not a user
choice.

I tried to hide it with <ft:styling type=""hidden> but it does not work

any idea ?

regards,
Stephane


PS : sorry for the useless noise, but I hope it will help someone, one day
....





Bitte antworten an users@cocoon.apache.org

An:   users@cocoon.apache.org
Kopie:

Thema:    Re: [Cforms] fd:action in struc, class or union special issue




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








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


Mime
View raw message