The events triggered by the default components used by the BeanEditor
can't be caught: those components are rendered from other pages, they
aren't part of your page hierarchy, so component events bubble up on
the other page hierarchy.

In addition, the client element ids are documented, but the component
ids are part of the implementation of BeanEditor or, more
specifically, the contributions to the BeanBlockSource service.

In other words, the TextField component that edits the backgroundURL
field is component  core/PropertyEditBlocks:textField, so any events
would have to be caught by PropertyEditBlocks, not your class.
Further, the exact same component, configured differently each time,
will be used to edit every property in your for that's data type is
"text".

On Thu, Apr 9, 2009 at 12:28 PM, Geoffrey Wiseman
<geoffrey.wise...@gmail.com> wrote:
> Whenever I try and capture validation events for a particular component in
> beaneditor / beaneditform, I fail.  I can catch the whole form, but not the
> individual components, anyone know why?
>
> I've got a form with a beaneditor in it, and I've added a field of my own,
> 'sponsor', but it also contains a bean with a number of fields, including
> "backgroundUrl".  I couldn't find many specifics about the component ids
> used by beaneditor fields, but the HTML implies that backgroundUrl gets a
> /client id/ of 'background url' at least.  I made a simple event handler
> method that always throws a ValidationException just for testing.
>
> The following methods trigger a validation error:
>
>   - @OnEvent("validate") validate(EventContext)
>   - @OnEvent(value="validate",component="sponsor") validate(EventContext)
>   - onValidateForm(EventContext)
>   - onValidateFromSponsor(EventContext)
>
> The following don't:
>
>   - @OnEvent(value="validate",component="backgroundUrl")
>   validate(EventContext)
>   - onValidateFromBackgroundUrl(EventContext)
>   - onValidateFromBackgroundurl(EventContext)
>
> In searching the mailing list, I'm finding other people having trouble
> validating, and other people who don't know what component id they're
> getting in a beaneditform, but no-one with answers.  ;)
>
> So ... what am I missing?  I'm sure it's simple, but I'm struggling with it
> nonetheless.
>
>  - Geoffrey
> --
> Geoffrey Wiseman
> http://www.geoffreywiseman.ca/
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to