I¹ve been looking into customization of the Tapestry client side validation
(those funky little error bubbles) and have a few questions!

So far, I¹ve been able to override the graphic for the bubbles, modify the
css and positioning of the bubbles. I¹m looking for ways to override what
events the validation gets fired on. A look at the Tapestry javascript shows
that Prototype is used for observing events and functions are provided for
handling those events:

document.observe(Tapestry.FOCUS_CHANGE_EVENT, function(event)
        {
            // Tapestry.debug("Focus change: #{memo} for #{field}", { memo:
event.memo.id, field: this.field.id });

            var focused = event.memo;

            if (focused == this.field)
            {
                this.fadeIn();
            }
            else
            {
                this.fadeOut();
            }
        }.bind(this));

Ideally we should be able to stop observing these events if we do not wish
the function to fire. For example, overriding the behavior so that the
bubbles only appear on form submit etc. However, a quick play around
suggests that because these event handler functions are anonymous, we cannot
stop observing it : see http://www.prototypejs.org/api/event/stopObserving
for details.

Maybe a solution to this is to make these event functions members of the
Tapestry javascript Object (or a more specific child object)?

Any ideas would be welcome.

Cheers

Ciaran

Reply via email to