You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Paul Bors <pa...@bors.ws> on 2013/05/01 23:23:58 UTC

What's a simple substitute for CancelEventIfNoAjaxDecorator in Wicket 6.x

 

I'm migrating from 5.x to 6.x and I have a few classes that make use of the
older IAjaxCallDecorator and I was wondering what's a simple substitution
for code like this:

 

add(new AjaxEventBehavior("onclick") {

  protected void onEvent(AjaxRequestTarget target) {

    ISortState state = stateLocator.getSortState();

      if (!defaultSortAsc && state.getPropertySortOrder(property) ==
SortOrder.NONE ) {

        state.setPropertySortOrder(property, SortOrder.ASCENDING);

      }

      onClick();

      onAjaxClick(target);

  }

  protected IAjaxCallDecorator getAjaxCallDecorator() {

    return new CancelEventIfNoAjaxDecorator(decorator);

  }

});

 

I have this for my own AjaxFallbackOrderByBorder I use for the sortable
headers in most of the table.

 

~ Thank you in advance,

    Paul Bors


RE: What's a simple substitute for CancelEventIfNoAjaxDecorator in Wicket 6.x

Posted by Paul Bors <pa...@bors.ws>.
I think I can drop my own class too since I found:
org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort.AjaxFallbackOrderByBorder<S>

I'll extend from that one and change the behavior I need :)

~ Thank you!
  Paul Bors

-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org] 
Sent: Wednesday, May 01, 2013 5:30 PM
To: users@wicket.apache.org
Subject: Re: What's a simple substitute for CancelEventIfNoAjaxDecorator in Wicket 6.x

Hi,

Just drop it. No need of it anymore.


On Wed, May 1, 2013 at 11:23 PM, Paul Bors <pa...@bors.ws> wrote:

>
>
> I'm migrating from 5.x to 6.x and I have a few classes that make use 
> of the older IAjaxCallDecorator and I was wondering what's a simple 
> substitution for code like this:
>
>
>
> add(new AjaxEventBehavior("onclick") {
>
>   protected void onEvent(AjaxRequestTarget target) {
>
>     ISortState state = stateLocator.getSortState();
>
>       if (!defaultSortAsc && state.getPropertySortOrder(property) == 
> SortOrder.NONE ) {
>
>         state.setPropertySortOrder(property, SortOrder.ASCENDING);
>
>       }
>
>       onClick();
>
>       onAjaxClick(target);
>
>   }
>
>   protected IAjaxCallDecorator getAjaxCallDecorator() {
>
>     return new CancelEventIfNoAjaxDecorator(decorator);
>
>   }
>
> });
>
>
>
> I have this for my own AjaxFallbackOrderByBorder I use for the 
> sortable headers in most of the table.
>
>
>
> ~ Thank you in advance,
>
>     Paul Bors
>
>


--
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>


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


Re: What's a simple substitute for CancelEventIfNoAjaxDecorator in Wicket 6.x

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Just drop it. No need of it anymore.


On Wed, May 1, 2013 at 11:23 PM, Paul Bors <pa...@bors.ws> wrote:

>
>
> I'm migrating from 5.x to 6.x and I have a few classes that make use of the
> older IAjaxCallDecorator and I was wondering what's a simple substitution
> for code like this:
>
>
>
> add(new AjaxEventBehavior("onclick") {
>
>   protected void onEvent(AjaxRequestTarget target) {
>
>     ISortState state = stateLocator.getSortState();
>
>       if (!defaultSortAsc && state.getPropertySortOrder(property) ==
> SortOrder.NONE ) {
>
>         state.setPropertySortOrder(property, SortOrder.ASCENDING);
>
>       }
>
>       onClick();
>
>       onAjaxClick(target);
>
>   }
>
>   protected IAjaxCallDecorator getAjaxCallDecorator() {
>
>     return new CancelEventIfNoAjaxDecorator(decorator);
>
>   }
>
> });
>
>
>
> I have this for my own AjaxFallbackOrderByBorder I use for the sortable
> headers in most of the table.
>
>
>
> ~ Thank you in advance,
>
>     Paul Bors
>
>


-- 
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>