Page navigation multiple click events put in queue...

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Page navigation multiple click events put in queue...

dharmendra pandey
Hi,

We want to block/queue the multiple click event on page navigation link when user already clicked on some link, We have written our implementation via extending NavigationToolbar and want to add the event to blocking queue.

Please see the implementation below...

@SuppressWarnings({ "serial", "rawtypes" })
public class LabTestPageNavigation<T> extends AjaxFallbackDefaultDataTable {

    @SuppressWarnings("unchecked")
    public <S> LabTestPageNavigation(final String id, final List<? extends IColumn<T, S>> columns, final ISortableDataProvider<T, S> dataProvider, final int rowsPerPage) {
        super(id, columns, dataProvider, rowsPerPage);
        setOutputMarkupId(true);
        setVersioned(false);
        addTopToolbar(new BlockLinkEvent(this));
        addTopToolbar(new AjaxFallbackHeadersToolbar(this, dataProvider));
        addBottomToolbar(new NoRecordsToolbar(this));
    }

   

    private class BlockLinkEvent extends NavigationToolbar {

        public BlockLinkEvent(DataTable<?, ?> table) {
            super(table);
                }

        @Override
        protected PagingNavigator newPagingNavigator(final String navigatorId, final DataTable<?, ?> table) {
            return new AjaxPagingNavigator(navigatorId, table) {

                private static final long serialVersionUID = 1L;

             
                @Override
                protected void onAjaxEvent(final AjaxRequestTarget target) {
                    target.add(table);
                    attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
                   
                }
            };
        }
    }

}



Please suggest.

Regards
dharmendra pandey
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

Martin Grigorov-4
Hi,


On Mon, Aug 4, 2014 at 5:26 PM, dharmendra pandey <
[hidden email]> wrote:

> Hi,
>
> We want to block/queue the multiple click event on page navigation link
> when
> user already clicked on some link, We have written our implementation via
> extending NavigationToolbar and want to add the event to blocking queue.
>
> Please see the implementation below...
>
> @SuppressWarnings({ "serial", "rawtypes" })
> public class LabTestPageNavigation<T> extends AjaxFallbackDefaultDataTable
> {
>
>     @SuppressWarnings("unchecked")
>     public <S> LabTestPageNavigation(final String id, final List<? extends
> IColumn<T, S>> columns, final ISortableDataProvider<T, S> dataProvider,
> final int rowsPerPage) {
>         super(id, columns, dataProvider, rowsPerPage);
>         setOutputMarkupId(true);
>         setVersioned(false);
>         addTopToolbar(new BlockLinkEvent(this));
>         addTopToolbar(new AjaxFallbackHeadersToolbar(this, dataProvider));
>         addBottomToolbar(new NoRecordsToolbar(this));
>     }
>
>
>
>     private class BlockLinkEvent extends NavigationToolbar {
>
>         public BlockLinkEvent(DataTable<?, ?> table) {
>             super(table);
>                 }
>
>         @Override
>         protected PagingNavigator newPagingNavigator(final String
> navigatorId, final DataTable<?, ?> table) {
>             return new AjaxPagingNavigator(navigatorId, table) {
>
>                 private static final long serialVersionUID = 1L;
>
>
>                 @Override
>                 protected void onAjaxEvent(final AjaxRequestTarget target)
> {
>                     target.add(table);
>                     attributes.setChannel(new AjaxChannel("blocking",
>

What is "attributes" in this context ?!
You should override #updateAjaxAttributes(AjaxRequestAttributes attributes)
to configure the Ajax call for this component.


> AjaxChannel.Type.ACTIVE));
>
>                 }
>             };
>         }
>     }
>
> }
>
>
>
> Please suggest.
>
> Regards
> dharmendra pandey
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Page-navigation-multiple-click-events-put-in-queue-tp4666862.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

dharmendra pandey
I want to DROP/BLOCK the request when user clicking multiple time on last page link

Now I want to DROP/BLOCK the request if the earlier request is already on progress..
I am using the Wicket AjaxFallbackDefaultDataTable to render the table data.

I just want to know how I can block/drop  the request click on last page of page link similar to below..

created a class and extended with NavigationToolbar and now want to drop the request on last page click.

I know that below method I have to use to drop the request but unable to use this method.

@Override
                protected void onAjaxEvent(final AjaxRequestTarget target) {
                    target.add(table);
                    attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.DROP));
                   
                }


Please suggest,
Regards
Dharmendra Pandey
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

Martin Grigorov-4
Please read my response from yesterday.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Tue, Aug 5, 2014 at 9:06 AM, dharmendra pandey <
[hidden email]> wrote:

> I want to DROP/BLOCK the request when user clicking multiple time on last
> page link
>
> Now I want to DROP/BLOCK the request if the earlier request is already on
> progress..
> I am using the Wicket AjaxFallbackDefaultDataTable to render the table
> data.
>
> I just want to know how I can block/drop  the request click on last page of
> page link similar to below..
>
> created a class and extended with NavigationToolbar and now want to drop
> the
> request on last page click.
>
> I know that below method I have to use to drop the request but unable to
> use
> this method.
>
> @Override
>                 protected void onAjaxEvent(final AjaxRequestTarget target)
> {
>                     target.add(table);
>                     attributes.setChannel(new AjaxChannel("blocking",
> AjaxChannel.Type.DROP));
>
>                 }
>
>
> Please suggest,
> Regards
> Dharmendra Pandey
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Page-navigation-multiple-click-events-put-in-queue-tp4666862p4666865.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

dharmendra pandey
Hi,

Thanks for your support, I am new to Wicket framework.
Using the custom page navigation api for capturing the event to drop here,
In BlockLinkEvent could you please suggest how I can use/call updateAjaxAttributes method  .

table = new LabTestPageNavigation<LabTestData, String>(tableId, columns, dataProvider, tableRows);
table.addBottomToolbar(new BlockLinkEvent(table));



@SuppressWarnings({ "serial", "rawtypes" })
public class LabTestPageNavigation<T> extends AjaxFallbackDefaultDataTable {

    @SuppressWarnings("unchecked")
    public <S> LabTestPageNavigation(final String id, final List<? extends IColumn<T, S>> columns, final ISortableDataProvider<T, S> dataProvider, final int rowsPerPage) {
        super(id, columns, dataProvider, rowsPerPage);
        setOutputMarkupId(true);
        setVersioned(false);
        addTopToolbar(new BlockLinkEvent(this));
        addTopToolbar(new AjaxFallbackHeadersToolbar(this, dataProvider));
        addBottomToolbar(new NoRecordsToolbar(this));
    }

    private class BlockLinkEvent extends NavigationToolbar {

        public BlockLinkEvent(DataTable<?, ?> table) {
            super(table);
        }

        @Override
        protected PagingNavigator newPagingNavigator(final String navigatorId, final DataTable<?, ?> table) {
            return new AjaxPagingNavigator(navigatorId, table) {

                private static final long serialVersionUID = 1L;

                @Override
                protected void onAjaxEvent(final AjaxRequestTarget target) {
                    target.add(table);
                }
               
                @Override
                protected void onConfigure() {
                    // TODO Auto-generated method stub
                    super.onConfigure();
                   
                }

                @Override
                protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
                    super.updateAjaxAttributes(attributes);
                    System.out.println("Hello world!   updateAjaxAttributes-----------------------------------------------------------------------------");
                    attributes.setChannel(new AjaxChannel("myChannel", AjaxChannel.Type.DROP));
                }
            };
        }

    }
}
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

Martin Grigorov-4
On Tue, Aug 5, 2014 at 10:03 AM, dharmendra pandey <
[hidden email]> wrote:

> Hi,
>
> Thanks for your support, I am new to Wicket framework.
> Using the custom page navigation api for capturing the event to drop here,
> In BlockLinkEvent could you please suggest how I can use/call
> updateAjaxAttributes method  .
>

There is no need your code to call it.
Wicket will call it.


>
> table = new LabTestPageNavigation<LabTestData, String>(tableId, columns,
> dataProvider, tableRows);
> table.addBottomToolbar(new BlockLinkEvent(table));
>
>
>
> @SuppressWarnings({ "serial", "rawtypes" })
> public class LabTestPageNavigation<T> extends AjaxFallbackDefaultDataTable
> {
>
>     @SuppressWarnings("unchecked")
>     public <S> LabTestPageNavigation(final String id, final List<? extends
> IColumn<T, S>> columns, final ISortableDataProvider<T, S> dataProvider,
> final int rowsPerPage) {
>         super(id, columns, dataProvider, rowsPerPage);
>         setOutputMarkupId(true);
>         setVersioned(false);
>         addTopToolbar(new BlockLinkEvent(this));
>         addTopToolbar(new AjaxFallbackHeadersToolbar(this, dataProvider));
>         addBottomToolbar(new NoRecordsToolbar(this));
>     }
>
>     private class BlockLinkEvent extends NavigationToolbar {
>
>         public BlockLinkEvent(DataTable<?, ?> table) {
>             super(table);
>         }
>
>         @Override
>         protected PagingNavigator newPagingNavigator(final String
> navigatorId, final DataTable<?, ?> table) {
>             return new AjaxPagingNavigator(navigatorId, table) {
>
>                 private static final long serialVersionUID = 1L;
>
>                 @Override
>                 protected void onAjaxEvent(final AjaxRequestTarget target)
> {
>                     target.add(table);
>                 }
>
>                 @Override
>                 protected void onConfigure() {
>                     // TODO Auto-generated method stub
>                     super.onConfigure();
>
>                 }
>
>                 @Override
>                 protected void updateAjaxAttributes(AjaxRequestAttributes
> attributes) {
>                     super.updateAjaxAttributes(attributes);
>                     System.out.println("Hello world!
>
> updateAjaxAttributes-----------------------------------------------------------------------------");
>                     attributes.setChannel(new AjaxChannel("myChannel",
> AjaxChannel.Type.DROP));
>

I think you want Type.ACTIVE here, as in your first message.


>                 }
>             };
>         }
>
>     }
> }
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Page-navigation-multiple-click-events-put-in-queue-tp4666862p4666867.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

dharmendra pandey
This post was updated on .
Hi Martin,

Thanks for quick response,

Yes I mentioned earlier with Type.ACTIVE. I am looking for Type.DROP or Type.ACTIVE.

I am getting the exceptions when user multiple clicks on page navigator link.

Regards
Dharmendra Pandey
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

Martin Grigorov-4
On Tue, Aug 5, 2014 at 11:15 AM, dharmendra pandey <
[hidden email]> wrote:

> Hi Martin,
>
> Thanks for quick response,
>
> Yes I mentioned earlier with Type.ACTIVE. I am looking for Type.DROP or
> Type.ACTIVE.
>

I am not sure what you mean by "I am looking for ...".
Is there a question here ?


>
> Regards
> Dharmendra Pandey
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Page-navigation-multiple-click-events-put-in-queue-tp4666862p4666870.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

dharmendra pandey
This post was updated on .
Hi Martin,

Looking for means...I don't know where to override updateAjaxAttributes method because AjaxFallbackDefaultDataTable has NavigationToolbar and we want to protect our application from user double click on pagination links.

So it would be highly appreciated if you help me and suggest where to put  updateAjaxAttributes method.So that our user application will be protected from double click exception on pagination clicked twice or more.

Please suggest in above mentioned example...
Reply | Threaded
Open this post in threaded view
|

Re: Page navigation multiple click events put in queue...

Martin Grigorov-4
You need to override
org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink#updateAjaxAttributes
and/or
org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationLink#updateAjaxAttributes

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Tue, Aug 5, 2014 at 12:01 PM, dharmendra pandey <
[hidden email]> wrote:

> Hi Martin,
>
> Looking for means...I don't know where to override updateAjaxAttributes
> method because AjaxFallbackDefaultDataTable has PaginationtoolBar and we
> want to protect our application from user double click on pagination links.
>
> So it would be highly appreciated if you help me and suggest where to put
> updateAjaxAttributes method.So that our user application will be protected
> from double click exception on pagination clicked twice or more.
>
> Please suggest in above mentioned example...
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Page-navigation-multiple-click-events-put-in-queue-tp4666862p4666873.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>