Re: RequiredBorder being applied multiple times in ajax calls

2008-05-16 Thread Sam Barnum
Awesome, that works! I forgot that you can always get the request from that ThreadLocal. Thanks a ton Gerolf, this doesn't seem too hacky. -- Sam Barnum 360 Works On May 15, 2008, at 10:58 AM, Gerolf Seitz wrote: On Thu, May 15, 2008 at 6:25 PM, Sam Barnum <[EMAIL PROTECTED]> wrote: *

Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Gerolf Seitz
On Thu, May 15, 2008 at 6:25 PM, Sam Barnum <[EMAIL PROTECTED]> wrote: > * Somehow disable the border only for ajax calls > Sam, I think you can do something like this in RequiredBorder#renderAfter: AjaxRequestTarget target = AjaxRequestTarget.get(); if (target == null) { // we're in a normal

Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Sam Barnum
Matthew, we wrote the phone formatter in house. It's way too messy to share on here. If I were going to rewrite it, I'd use regex to: * Strip everything except [0-9x#] from the input * Everthing before the 'x' or '#' is the phone number, everything after is the extension * Count the number

Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Sam Barnum
Gerolf, Thanks for the reply. WicketAjaxIndicatorAppender is a behavior, but my RequiredBorder is a border. It seems like there's got to be an easy answer to this that doesn't require a javascript hack. Here's what I think is happening: * The phone format is rendered on the first pass, a

Re: RequiredBorder being applied multiple times in ajax calls

2008-05-14 Thread Gerolf Seitz
Sam, a similar issue happened to the WicketAjaxIndicatorAppender. take a look at WicketAjaxIndicatorAppender#renderHead to see how this is solved there. maybe you can do something similar with your RequiredBorder. regards, Gerolf On Thu, May 15, 2008 at 2:58 AM, Sam Barnum <[EMAIL PROTECTED]> w

Re: RequiredBorder being applied multiple times in ajax calls

2008-05-14 Thread Matthew Young
Sorry I can't help you with your question. But may I ask where you get the PhoneFormatter? On Wed, May 14, 2008 at 5:58 PM, Sam Barnum <[EMAIL PROTECTED]> wrote: > Using the tips in this PDF > http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf > > I created the simple RequiredBorder

RequiredBorder being applied multiple times in ajax calls

2008-05-14 Thread Sam Barnum
Using the tips in this PDF http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf I created the simple RequiredBorder class as follows: public class RequiredBorder extends MarkupComponentBorder { public void renderAfter(Component component) { FormComponent fc = (