Re: jquery DataTable + wicket Cannot bind a listener

2014-10-28 Thread Martin Grigorov
Hi, You should read about JavaScript event delegation. This is what they recommend. Wicket has basic support for this with org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setChildSelector. I.e. you can register an Ajax behavior on the table or tbody and use childSelector to listen for

Re: jquery DataTable + wicket Cannot bind a listener

2014-10-28 Thread Jason Novotny
Hi Martin, Are there examples? What about this simple piece of code... WebMarkupContainer tbody = new WebMarkupContainer(tbody); tbody.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { }

Re: jquery DataTable + wicket Cannot bind a listener

2014-10-28 Thread Martin Grigorov
Hi, On Tue, Oct 28, 2014 at 5:00 PM, Jason Novotny jason.novo...@gmail.com wrote: Hi Martin, Are there examples? What about this simple piece of code... I don't have any open source example at hand ... :-/ WebMarkupContainer tbody = new WebMarkupContainer(tbody); tbody.add(new

Re: jquery DataTable + wicket Cannot bind a listener

2014-10-27 Thread Martin Grigorov
Hi, Try with Ajax loading of the new pages. I am not sure how DataTables removes and re-adds the rows later. It should use jQuery's clone(true, true) to preserve the event bindings. Ask in their forums. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Sun, Oct

Re: jquery DataTable + wicket Cannot bind a listener

2014-10-27 Thread Jason Novotny
Hi Martin, Thanks for the help-- I've reached out to them, the js appears pretty complex http://cdn.datatables.net/1.10.3/js/jquery.dataTables.js They indicate that listeners need to be added according to: http://www.datatables.net/examples/advanced_init/events_live.html Is there any kind

Re: jquery DataTable + wicket Cannot bind a listener

2014-10-25 Thread Jason Novotny
I've managed to figure out the cause of the problem but no solution. jquery datatables removes DOM elements when configured for pagination. This means the AjaxLinks in my listview generate wicket javascript like:

Re: jquery DataTable + wicket Cannot bind a listener

2014-10-24 Thread Jason Novotny
I should add I'm using Wicket 6.17. Thanks, Jason On 10/24/14, 10:47 AM, Jason Novotny wrote: Hi, I'm using latest jquery DataTable with a ListView and in wicket:head of the page, I initiate the DataTable: $(function () { $('.datatable_executed').dataTable({