isn't event name: validateForm

http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html

under SubmitEvents topic

Davor Hrg

On Thu, Mar 6, 2008 at 4:56 PM, Joel Wiegman <[EMAIL PROTECTED]> wrote:
> componentResources.triggerEvent() appears to be broken in
>  T5.0.11-SNAPSHOT
>
>  I have the following situation:
>
>  public class LayoutClass {
>
>         @Component
>         private Form editControlForm;
>
>         public void onValidateFromEditControlForm() {
>                 resources.triggerEvent("formValidate", null, null);
>         }
>
>  }
>
>  public class BaseClassThatUsesLayout {
>
>         @Inject
>         private LayoutClass layout;
>
>  }
>
>  public class SpecificPage extends BaseClassThatUsesLayout {
>
>         public void onFormValidate() {
>                 System.out.println("Form validated!");
>         }
>
>  }
>
>  When I upgraded from 5.0.7 to T5.0.11-SNAPSHOT the onFormValidate() is
>  no longer called.
>
>  Please advise... Thanks!
>
>
>
>
>  -----Original Message-----
>  From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
>
>
> Sent: Friday, December 28, 2007 5:23 PM
>  To: Tapestry users
>  Subject: Re: T5.0.7 Validation error
>
>  On Dec 28, 2007 1:44 PM, Joel Wiegman <[EMAIL PROTECTED]> wrote:
>  > Ouch... That change botches up my current application pretty
>  thoroughly.
>  >
>  > I don't think the event needs to be re-named... but consider the
>  > following situation:
>  >
>  > If a form is in a layout component that other pages use via the
>  > @Component annotation (say because most of the forms look very similar
>
>  > and they want to re-use the presentation and validation logic), they
>  > have no way of validating their forms in the pages, because they no
>  > longer have access to the validate event from the form.
>
>  You can do onValidateFromLayout() ... that is, if Form is inside Layout,
>  then the event will bubble up from Layout to your page, and will appear
>  to originate with Layout.
>
>  Alternately, the Layout component could capture the Form's validate
>  event and trigger a new event with a name of your choice:
>
>  boolean onValidateFromForm()
>  {
>   _componentResources.trigger("layoutvalidate", null, null); }
>
>  >
>  > I tried using the onValidateFromIndividualField() technique... the
>  > behavior of that seemed inconsistent (had to submit the form twice to
>  > get the event to fire???).
>
>  Huh?
>
>  Are you sure your client-side validation wasn't preventing the form
>  submission?
>  >
>  > How does one log these events to see which events are firing?
>
>  That isn't really logged right now.
>
>  >
>  > Looks like I'll have to start validation over from ground zero if I
>  > want to upgrade to 5.0.7...
>  >
>  > Perhaps the validation doc page could be updated with advice on proper
>
>  > validation techniques?
>  >
>  >
>  > -----Original Message-----
>  > From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
>  >
>  > Sent: Friday, December 28, 2007 3:25 PM
>  > To: Tapestry users
>  > Subject: Re: T5.0.7 Validation error
>  >
>  > Tapestry 5.0.7 adds a new way of validating input from the client, a
>  > validate event that is emitted from individual components and is
>  > distinct from the validate event from the form. The event handler
>  > method you already had, that was intended for cross-form validation
>  > after values are in place, is being executed too early, for each
>  field.
>  > Sorry, unexpected consequences.  Perhaps the form's event should be
>  > renamed from "validate" to "formValidate"?
>  >
>  > Change your method name from onValidate() to onValidateFromForm()
>  > (adjusting for your form's id).
>  >
>  > On Dec 28, 2007 12:02 PM, Joel Wiegman <[EMAIL PROTECTED]> wrote:
>  > > There appears to be a bug with 5.0.7 in that any custom validation
>  > > method ( onValidate(), etc. ) gets called before the HTTP values get
>
>  > > bound to the Tapestry component.  Can anyone else confirm this?
>  > >
>  > > -----Original Message-----
>  > > From: Joel Wiegman [mailto:[EMAIL PROTECTED]
>  > > Sent: Friday, December 28, 2007 2:40 PM
>  > > To: Tapestry users
>  > >
>  > > Subject: RE: T5.0.7 Validation error
>  > >
>  > > I'm trying to upgrade to 5.0.7 and can't get screens (that validated
>
>  > > just fine with 5.0.6) to validate either.
>  > >
>  > > Will re-post once I find out more.
>  > >
>  > > -----Original Message-----
>  > > From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
>  > > Sent: Friday, December 28, 2007 2:05 PM
>  > > To: Tapestry users
>  > > Subject: Re: T5.0.7 Validation error
>  > >
>  > > Try clearing your browser cache, you may have the old tapestry.js
>  > > stuck in there.
>  > >
>  > > On Dec 28, 2007 10:29 AM, Marcelo Lotif <[EMAIL PROTECTED]>
>  wrote:
>  > > > When i switch to the 5.0.7 version, the validations of my
>  > > > BeanEditForms doesn't work properly...
>  > > > I have a BEF to add a user to the database. When i click on the
>  > > > submit
>  > >
>  > > > button, it must validate the fields and go to another page to show
>
>  > > > all
>  > >
>  > > > the users on the database. If there are errors on the validation,
>  > > > it
>  >
>  > > > must stay at the same page and show the errors to the user (as
>  > > > expected). When i switch to 5.0.7, even if i get some errors, the
>  > > > page
>  > >
>  > > > goes to the another one and the it ends up to add the user to the
>  > > > database with the errors. The funny thing is when i come back to
>  > > > the
>  >
>  > > > page, the errors are there... If i switch back to 5.0.6,
>  > > > everything
>  > > works fine again.
>  > > >
>  > > > Am i missing something or this is really an error?
>  > > >
>  > > > --
>  > > > Atenciosamente,
>  > > > Marcelo Lotif
>  > > >
>  > >
>  > >
>  > >
>  > > --
>  > > Howard M. Lewis Ship
>  > >
>  > > Creator Apache Tapestry and Apache HiveMind
>  > >
>  > > --------------------------------------------------------------------
>  > > - 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]
>  > >
>  > >
>  > > --------------------------------------------------------------------
>  > > - To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > > For additional commands, e-mail: [EMAIL PROTECTED]
>  > >
>  > >
>  >
>  >
>  >
>  > --
>  > Howard M. Lewis Ship
>  >
>  > Creator Apache Tapestry and Apache HiveMind
>  >
>  > ---------------------------------------------------------------------
>  > 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]
>  >
>  >
>
>
>
>  --
>  Howard M. Lewis Ship
>
>  Creator Apache Tapestry and Apache HiveMind
>
>  ---------------------------------------------------------------------
>  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]
>
>

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

Reply via email to