You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Krasnay <jo...@krasnay.ca> on 2008/08/22 15:00:36 UTC

AbstractDefaultAjaxBehavior.findIndicatorId()

I have a small request regarding AJAX indicators.

It's sometimes awkward to implement an AJAX indicator the standard way,
by implementing IAjaxIndicatorAware, since it forces me to use an
explicit class where I otherwise would have used an anonymous inner
class. I actually have this code in one of my classes:

private static abstract class IAFCCUB 
    extends AjaxFormChoiceComponentUpdatingBehavior 
    implements IAjaxIndicatorAware {
}
            
I then use several times on the page for anonymous inner classes. (The
'I' in IAFCCUB is for "Indicating". I couldn't bear to type the rest of
the name!)

It occurred to me that this would be much simpler if
AbstractDefaultAjaxBehaviour.findIndicatorId() were made protected and
non-final rather than private. Then I could just override it in my
anonymous inner class.

Any thoughts? I'd be happy to create an RFE if others think this would
be worthwhile.

jk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AbstractDefaultAjaxBehavior.findIndicatorId()

Posted by John Krasnay <jo...@krasnay.ca>.
I've added https://issues.apache.org/jira/browse/WICKET-1801 to cover
this.

jk

On Fri, Aug 22, 2008 at 09:00:36AM -0400, John Krasnay wrote:
> I have a small request regarding AJAX indicators.
> 
> It's sometimes awkward to implement an AJAX indicator the standard way,
> by implementing IAjaxIndicatorAware, since it forces me to use an
> explicit class where I otherwise would have used an anonymous inner
> class. I actually have this code in one of my classes:
> 
> private static abstract class IAFCCUB 
>     extends AjaxFormChoiceComponentUpdatingBehavior 
>     implements IAjaxIndicatorAware {
> }
>             
> I then use several times on the page for anonymous inner classes. (The
> 'I' in IAFCCUB is for "Indicating". I couldn't bear to type the rest of
> the name!)
> 
> It occurred to me that this would be much simpler if
> AbstractDefaultAjaxBehaviour.findIndicatorId() were made protected and
> non-final rather than private. Then I could just override it in my
> anonymous inner class.
> 
> Any thoughts? I'd be happy to create an RFE if others think this would
> be worthwhile.
> 
> jk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AbstractDefaultAjaxBehavior.findIndicatorId()

Posted by John Krasnay <jo...@krasnay.ca>.
On Fri, Aug 29, 2008 at 09:38:20PM +0300, Timo Rantalaiho wrote:
> On Fri, 22 Aug 2008, John Krasnay wrote:
> > It's sometimes awkward to implement an AJAX indicator the standard way,
> > by implementing IAjaxIndicatorAware, since it forces me to use an
> > explicit class where I otherwise would have used an anonymous inner
> > class. I actually have this code in one of my classes:
> 
> There's still the kludge of making a named local inner class
> 
>     Form myForm = new Form("foo", model);
>     TextField myField = new TextField("bar");
>     class BarsBehavior extends AjaxFormChoiceComponentUpdatingBehavior implements IAjaxIndicatorAware {
>         ...
>     }
>     myField.add(new BarsBehavior());
>     ...

You can do that?! Wow, learn something new every day.

Thanks for the tip.

jk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AbstractDefaultAjaxBehavior.findIndicatorId()

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Fri, 22 Aug 2008, John Krasnay wrote:
> It's sometimes awkward to implement an AJAX indicator the standard way,
> by implementing IAjaxIndicatorAware, since it forces me to use an
> explicit class where I otherwise would have used an anonymous inner
> class. I actually have this code in one of my classes:

There's still the kludge of making a named local inner class

    Form myForm = new Form("foo", model);
    TextField myField = new TextField("bar");
    class BarsBehavior extends AjaxFormChoiceComponentUpdatingBehavior implements IAjaxIndicatorAware {
        ...
    }
    myField.add(new BarsBehavior());
    ...

> It occurred to me that this would be much simpler if
> AbstractDefaultAjaxBehaviour.findIndicatorId() were made protected and
> non-final rather than private. Then I could just override it in my
> anonymous inner class.

Thanks, that sounds like a good idea to me.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org