>From my experince on Tap3, I think you can set a page property to hold the "which button clicked" name, and apply a tag attribute to each button (submit and search) which gets stuffed into the property.
My template code looks like this, where there's a String property-specification in the *.page called "buttonClicked"... <input jwcid="update[at]Submit" label="Update Schedule" tag="save" selected="ognl:buttonClicked" Put a listener on the form only, and interrogate that button-clicked property name and you then have a switch to include in your server-side form processing or validation code. public void onScheduleFormSubmit(IRequestCycle cycle) { if(getButtonClicked().equals("default")) { ... If you need to do client-side validation disabling for clicks on the search button, that's another story... </bd> -----Original Message----- From: Simon Raveh [mailto:[EMAIL PROTECTED] Sent: Sunday, August 13, 2006 9:50 PM To: Karthik N Cc: Tapestry users Subject: Re: custom validator based on which button pressed One of my requirements is for the application to work correctly when javascript is turned off. Simon Karthik N wrote: > any reason why you'd not like to use javascript? > > On 8/11/06, *Simon Raveh* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Is there a way to tie a submit button to the refresh/cancel listener > without using javascript using tapestry 4.0 > > Simon > > Karthik N wrote: > > your search should be bound to the form refresh listener - that way > > validations won't fire. > > > > On 8/11/06, Theo vN < [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > >> > >> Hi > >> > >> I use the same Form to either create (create button) a record or to > >> search (search button) for records. > >> > >> I want to do input validation (only server-side is ok) when I > create a > >> record but not for when I search (maybe even other validation > rules > >> for when I search). > >> > >> The build in tapestry validation seems to occur before "action" and > >> "listener" invocations take place. > >> > >> What "hook" can I use to setup a custom validator (as required > or null > >> or whatever) based upon which button was pressed (or which > listener > >> is going to be invoked). > >> > >> One could of course do the validation "by hand" in the final > listener > >> methods, but that would be a pity. > >> > >> Thanks in advance > >> -- > >> Regards > >> Theo > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > >> For additional commands, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > >> > >> > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > > > > -- > Thanks, Karthik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]