How does the ajax logic get executed if the client doesn't have
Javascript enabled?

On Sun, Aug 15, 2010 at 10:23 AM, Don Ferguson <don.fergu...@gmail.com> wrote:
> When using AjaxRequestTarget, one always has to check for null, as in:
>
> if (target != null) {
>        target.addComponent(...);
> }
>
> or suffer the consequences of an NPE at deployment time for users who don't 
> have javascript enabled.
>
> It would make life easier if Wicket just supplied a no-op AjaxRequestTarget 
> into the onClick() method, rather than null.  Then the code wouldn't need to 
> check for null;  the AjaxRequestTarget would always be instantiated.  And if 
> the code really needs to know whether it's dealing with an Ajax request, it 
> can do an instanceof, as in:
>
> if (! target instanceof NoopAjaxRequestTarget) {
>        ....
> }
>
> Thoughts?
>
>        -Don
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to