You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Fe...@thomson.com on 2006/03/16 13:38:17 UTC
CForms: multiple fd:submit
How can one react differently in a flow when there are several fd:submit
elements in a form?
Thanks
Re: CForms: multiple fd:submit
Posted by "Fernando D. Mato Mira" <ma...@acm.org>.
It also doesn't work on 2.1.8, but when I try to use this workaround I get:
org.mozilla.javascript.EcmaError: foo is not a function.
where foo is the id of the button I pressed.
It shows the discriminator line as the location of the error.
Josep A. Frau wrote:
> This code don't work for me en Cocoon 2.1.7. I think its a problem
> with the javascript type.
>
> I use:
>
> form.showForm();
> switch(* String (*form.submitId)) {
> case "details":
> showDetails();
> break;
> case "create":
> createNew();
> break;
> case "cart":
> redisplayForm = false;
> showCart();
> break;
> case "ok":
> redisplayForm = false;
> processForm(form);
> break;
> }
>
>
>
>
>
> En/na Jeroen Reijn ha escrit:
>
>> Hi Fernando,
>>
>> You can react in flow based on the submitId of the form.
>>
>> You can request the submitId from flow by using:
>>
>> form.submitId
>>
>> Example:
>>
>> form.showForm();
>> switch(form.submitId) {
>> case "details":
>> showDetails();
>> break;
>> case "create":
>> createNew();
>> break;
>> case "cart":
>> redisplayForm = false;
>> showCart();
>> break;
>> case "ok":
>> redisplayForm = false;
>> processForm(form);
>> break;
>> }
>>
>> I found the example in the archives.
>>
>> Regards,
>>
>> Reijn
>>
>>
>>
>> Fernando.Matomira@thomson.com wrote:
>>
>>> How can one react differently in a flow when there are several
>>> fd:submit elements in a form?
>>>
>>>
>>>
>>> Thanks
>>>
>>
>> Kind regards,
>>
>> Jeroen Reijn
>>
>> Hippo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
>--
>Josep A. Frau <pe...@uib.es>
>Centre de Tecnologies de la InformaciĆ³
>Universitat de les Illes Balears
>
>
--
--
Fernando D. Mato Mira matomira@acm.org
Thomson Corporation Switzerland AG
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: CForms: multiple fd:submit
Posted by "Josep A. Frau" <pe...@uib.es>.
This code don't work for me en Cocoon 2.1.7. I think its a problem with
the javascript type.
I use:
form.showForm();
switch(* String (*form.submitId)) {
case "details":
showDetails();
break;
case "create":
createNew();
break;
case "cart":
redisplayForm = false;
showCart();
break;
case "ok":
redisplayForm = false;
processForm(form);
break;
}
En/na Jeroen Reijn ha escrit:
> Hi Fernando,
>
> You can react in flow based on the submitId of the form.
>
> You can request the submitId from flow by using:
>
> form.submitId
>
> Example:
>
> form.showForm();
> switch(form.submitId) {
> case "details":
> showDetails();
> break;
> case "create":
> createNew();
> break;
> case "cart":
> redisplayForm = false;
> showCart();
> break;
> case "ok":
> redisplayForm = false;
> processForm(form);
> break;
> }
>
> I found the example in the archives.
>
> Regards,
>
> Reijn
>
>
>
> Fernando.Matomira@thomson.com wrote:
>> How can one react differently in a flow when there are several
>> fd:submit elements in a form?
>>
>>
>>
>> Thanks
>>
>
> Kind regards,
>
> Jeroen Reijn
>
> Hippo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
Josep A. Frau <pe...@uib.es>
Centre de Tecnologies de la InformaciĆ³
Universitat de les Illes Balears
Re: CForms: multiple fd:submit
Posted by Jeroen Reijn <j....@hippo.nl>.
Hi Fernando,
You can react in flow based on the submitId of the form.
You can request the submitId from flow by using:
form.submitId
Example:
form.showForm();
switch(form.submitId) {
case "details":
showDetails();
break;
case "create":
createNew();
break;
case "cart":
redisplayForm = false;
showCart();
break;
case "ok":
redisplayForm = false;
processForm(form);
break;
}
I found the example in the archives.
Regards,
Reijn
Fernando.Matomira@thomson.com wrote:
> How can one react differently in a flow when there are several fd:submit
> elements in a form?
>
>
>
> Thanks
>
Kind regards,
Jeroen Reijn
Hippo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org