You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Timothy Larson <ti...@yahoo.com> on 2003/11/10 18:08:35 UTC

Woody sample bug

In the first Woody sample, "Various", if you:
  (1) Change the value in the first number field, "Please enter a number"
  (2) Then press "Add contact" or "Remove selected contacts" *before*
      tabbing or clicking into any other field.
Then you will receive an error page with this message:
  java.lang.IllegalStateException: SubmitWidget can only be set once.

It is caused by two widgets submitting at once, specifically the action
button that is pressed and the action attached to the first number field.
The number's action is delayed until editing is complete, which is noticed
when leaving the field.  In this case, leaving the field happens at the
same time as clicking on an action button.

How should we handle this case?

--Tim Larson



__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

Re: Woody sample bug

Posted by Sylvain Wallez <sy...@apache.org>.
Timothy Larson wrote:

>In the first Woody sample, "Various", if you:
>  (1) Change the value in the first number field, "Please enter a number"
>  (2) Then press "Add contact" or "Remove selected contacts" *before* tabbing or clicking into any other field.
>Then you will receive an error page with this message:
>  java.lang.IllegalStateException: SubmitWidget can only be set once.
>
>It is caused by two widgets submitting at once, specifically the action button that is pressed and the action attached to the first number field. The number's action is delayed until editing is complete, which is noticed when leaving the field.  In this case, leaving the field happens at the same time as clicking on an action button.
>
>How should we handle this case?
>  
>

Mmmh... the onchange() handler on the input registers the input name in 
the hidden woody_submit_id field, and the action button's name is also 
passed as a request parameter, leading to this double detection.

A solution would be to set the woody_submit_id field also on a regular 
submit button, but which one would win: the button or the input? Is this 
predictable?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: Woody sample bug

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Timothy Larson dijo:
> --- Antonio Gallardo <ag...@agsoftware.dnsalias.com> wrote:
> <snip description how to trigger bug, etc.>
>> In Fedora core 1 (BTW, I installed it right now :-D ) using mozilla
>> 1.4.1
>> I don't have the related problem.
>
> Could you check your Cocoon logs to see if your mozilla is sending two
> submits
> in sequence?  That is the only way I can think of that you would not get
> the
> error.

I setted the woody log to debug and nothing is in woody.log. In
catalina.out, there is a log: "Was here!" Also the "Add contact" button
does not added a new row to the grid.

Is this info enough?

Best Regards,

Antonio Gallardo


Re: Woody sample bug

Posted by Timothy Larson <ti...@yahoo.com>.
--- Antonio Gallardo <ag...@agsoftware.dnsalias.com> wrote:
<snip description how to trigger bug, etc.>
> In Fedora core 1 (BTW, I installed it right now :-D ) using mozilla 1.4.1
> I don't have the related problem.

Could you check your Cocoon logs to see if your mozilla is sending two submits
in sequence?  That is the only way I can think of that you would not get the
error.

--Tim Larson


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

Re: Woody sample bug

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Antonio Gallardo dijo:
> Timothy Larson dijo:
>> In the first Woody sample, "Various", if you:
>>   (1) Change the value in the first number field, "Please enter a
>> number" (2) Then press "Add contact" or "Remove selected contacts"
>> *before*
>>       tabbing or clicking into any other field.
>> Then you will receive an error page with this message:
>>   java.lang.IllegalStateException: SubmitWidget can only be set once.
>>
>> It is caused by two widgets submitting at once, specifically the
>> action button that is pressed and the action attached to the first
>> number field. The number's action is delayed until editing is
>> complete, which is noticed when leaving the field.  In this case,
>> leaving the field happens at the same time as clicking on an action
>> button.
>>
>> How should we handle this case?
>
> Hi:
>
> I tried with the CVS version and I don't had the problem. What version
> are u using?

Sorry, I miss the point. It looks to be another "MS feature" :-D

In Fedora core 1 (BTW, I installed it right now :-D ) using mozilla 1.4.1
I don't have the related problem.

Best Regards,

Antonio Gallardo




Re: Woody sample bug

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Timothy Larson dijo:
> In the first Woody sample, "Various", if you:
>   (1) Change the value in the first number field, "Please enter a
> number" (2) Then press "Add contact" or "Remove selected contacts"
> *before*
>       tabbing or clicking into any other field.
> Then you will receive an error page with this message:
>   java.lang.IllegalStateException: SubmitWidget can only be set once.
>
> It is caused by two widgets submitting at once, specifically the action
> button that is pressed and the action attached to the first number
> field. The number's action is delayed until editing is complete, which
> is noticed when leaving the field.  In this case, leaving the field
> happens at the same time as clicking on an action button.
>
> How should we handle this case?

Hi:

I tried with the CVS version and I don't had the problem. What version are
u using?

Best Regards,

Antonio Gallardo