Re: Form event order issues

2008-07-07 Thread Udo Abel
Thanks Geoff,

yes, that approach certainly solves most situations.

Nevertheless there may be situations, in which more than one submit button is 
necessary. E.G., an universal search-form where the user can enter some search 
strings and then press Search Customers, Search Suppliers or so.
Of course, that can be solved with a select-box Search In - but even if my 
client would accept that, I still think that the button events should be known 
before validation takes place...

Regards,
Udo.

 Original-Nachricht 
 Datum: Sat, 5 Jul 2008 11:19:06 +1000
 Von: Geoff Callender [EMAIL PROTECTED]
 An: Tapestry users users@tapestry.apache.org
 Betreff: Re: Form event order issues

 Sorry but the technique I posted for an Abort button doesn't work in  
 IE7.   However, the Buttons component from t5components does work.
 
   button t:type=t5components/Button type=button  
 t:event=abortAbort/button
 See http://87.193.218.134:8080/t5c-demo/buttonpage .
 Get t5c-commons and t5c-contrib jars from
 http://code.google.com/p/tapestry5-components/ 
   .
 To work, the jars must be deployed in WEB-INF/lib .
 Cheers,
 Geoff
 
 
 On 04/07/2008, at 9:53 PM, Geoff Callender wrote:
 
  I'm assuming Abort can ignore what you've typed into the form, in  
  which case the more common technique is to use a link component  
  instead of a submit.  That way you bypass the validators.  You can  
  style a link to look like the submit button easily enough if that's  
  what you'd like, eg.
 
  input type=submit value=Save/
  a t:type=pagelink t:page=thePreviousPage style=text- 
  decoration: none
  input type=button value=Abort/
  /a
 
  Or use t5components/Submit from
 http://87.193.218.134:8080/t5c-demo/buttonpage 
  .
 
  By the way, onSuccess() is a dangerous place to put validation.  See
 https://issues.apache.org/jira/browse/TAPESTRY-1972 
   .
 
  Cheers,
  Geoff
 
  On 04/07/2008, at 8:40 PM, Udo Abel wrote:
 
  Hi,
 
  I think the order of events during form submission should be  
  described in a state diagram or so, otherwise you cannot know when  
  to do what.
 
  I found out that the onValidate event is fired before any button  
  select event.  That means, in onValidateForm you don't know whether  
  the user pressed save or abort - which  should be known for  
  validation.
  That's probably the reason why I found so many people using  
  onSuccess for validation, what I find not very beautiful.
 
  Since form submission is very essential, I think the system (and  
  the documentation) should be very clear at that point, which is not  
  yet the case.
 
  Regards,
  Udo.
  -- 
  Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
  Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Form event order issues

2008-07-04 Thread Udo Abel
Hi,

I think the order of events during form submission should be described in a 
state diagram or so, otherwise you cannot know when to do what.

I found out that the onValidate event is fired before any button select event.  
That means, in onValidateForm you don't know whether the user pressed save or 
abort - which  should be known for validation.
That's probably the reason why I found so many people using onSuccess for 
validation, what I find not very beautiful.

Since form submission is very essential, I think the system (and the 
documentation) should be very clear at that point, which is not yet the case.

Regards,
Udo.
-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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



Re: Form event order issues

2008-07-04 Thread Geoff Callender
I'm assuming Abort can ignore what you've typed into the form, in  
which case the more common technique is to use a link component  
instead of a submit.  That way you bypass the validators.  You can  
style a link to look like the submit button easily enough if that's  
what you'd like, eg.


input type=submit value=Save/
	a t:type=pagelink t:page=thePreviousPage style=text-decoration:  
none

input type=button value=Abort/
/a

Or use t5components/Submit from http://87.193.218.134:8080/t5c-demo/buttonpage 
.


By the way, onSuccess() is a dangerous place to put validation.  See https://issues.apache.org/jira/browse/TAPESTRY-1972 
 .


Cheers,
Geoff

On 04/07/2008, at 8:40 PM, Udo Abel wrote:


Hi,

I think the order of events during form submission should be  
described in a state diagram or so, otherwise you cannot know when  
to do what.


I found out that the onValidate event is fired before any button  
select event.  That means, in onValidateForm you don't know whether  
the user pressed save or abort - which  should be known for  
validation.
That's probably the reason why I found so many people using  
onSuccess for validation, what I find not very beautiful.


Since form submission is very essential, I think the system (and the  
documentation) should be very clear at that point, which is not yet  
the case.


Regards,
Udo.
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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





Re: Form event order issues

2008-07-04 Thread Geoff Callender
Sorry but the technique I posted for an Abort button doesn't work in  
IE7.   However, the Buttons component from t5components does work.


	button t:type=t5components/Button type=button  
t:event=abortAbort/button

See http://87.193.218.134:8080/t5c-demo/buttonpage .
Get t5c-commons and t5c-contrib jars from http://code.google.com/p/tapestry5-components/ 
 .

To work, the jars must be deployed in WEB-INF/lib .
Cheers,
Geoff


On 04/07/2008, at 9:53 PM, Geoff Callender wrote:

I'm assuming Abort can ignore what you've typed into the form, in  
which case the more common technique is to use a link component  
instead of a submit.  That way you bypass the validators.  You can  
style a link to look like the submit button easily enough if that's  
what you'd like, eg.


input type=submit value=Save/
	a t:type=pagelink t:page=thePreviousPage style=text- 
decoration: none

input type=button value=Abort/
/a

Or use t5components/Submit from http://87.193.218.134:8080/t5c-demo/buttonpage 
.


By the way, onSuccess() is a dangerous place to put validation.  See https://issues.apache.org/jira/browse/TAPESTRY-1972 
 .


Cheers,
Geoff

On 04/07/2008, at 8:40 PM, Udo Abel wrote:


Hi,

I think the order of events during form submission should be  
described in a state diagram or so, otherwise you cannot know when  
to do what.


I found out that the onValidate event is fired before any button  
select event.  That means, in onValidateForm you don't know whether  
the user pressed save or abort - which  should be known for  
validation.
That's probably the reason why I found so many people using  
onSuccess for validation, what I find not very beautiful.


Since form submission is very essential, I think the system (and  
the documentation) should be very clear at that point, which is not  
yet the case.


Regards,
Udo.
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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