Re: jquery DataTable + wicket Cannot bind a listener
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 26, 2014 at 12:46 AM, Jason Novotny jason.novo...@gmail.com wrote: 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: Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-0-detailsLink,e:click,c: detailsLinkff});; Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-1-detailsLink,e:click,c: detailsLink100});; Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-2-detailsLink,e:click,c: detailsLink101});; Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-3-detailsLink,e:click,c: detailsLink102});; ... If the table has 2 pages, it removes the DOM elements from the 2nd page so I get the wicket debug error Wicket.Ajax: Cannot bind a listener for event click on element elementId because the element is not in the DOM Now when I hit the link for next page of the table, the DOM has been updated to reflect the rows, but the javascript events need to be added again and so the links are broken. Is there any good way to do this? Thanks, Jason On 10/24/14, 1:24 PM, Jason Novotny wrote: 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({ 'lengthChange': false, 'dom': 'topdoc-filterholdeript', language: {info: _START_-_END_ of _TOTAL_}, aaSorting: [], 'iDisplayLength': 12 }); }); It all looks good, however because one of my columns contains AjaxLinks, I get an error from my wicket debug window with the following: Wicket.Ajax: Cannot bind a listener for event click on element elementId because the element is not in the DOM The thing is the links seem to actually work on the first page, but when I click - to go to the next page the links don't work. Has anyone experienced this before or have any idea how I can debug this? Thanks, Jason
Re: Wicket error page runs twice
The exception occurred within an AjaxButton. In this case, a service was not responding, we want to show our error page, and put a custom message up indicating that it is a service problem, call the help line or try again later blah blah blah... I don't think any redirects are involved. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668109.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket error page runs twice
On Mon, Oct 27, 2014 at 1:26 PM, Entropy blmulholl...@gmail.com wrote: The exception occurred within an AjaxButton. In this case, a service was not responding, we want to show our error page, and put a custom message up indicating that it is a service problem, call the help line or try again later blah blah blah... I don't think any redirects are involved. Better check with the browser's Dev tools. Or put a breakpoint at WicketFilter#doFilter(). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668109.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket error page runs twice
Well, you are definitely right that there are multiple requests for whatever reason. I can see WicketServlet doPost called, the method runs, throws the error, the error page gets control with the exception, then a doGet occurs and the error page runs again without the exception. I can't really see the details as I don't have the source for Wicket 6.12.0. I went to http://www.apache.org/dyn/closer.cgi/wicket/6.12.0 and none of the links work. Where can I download 6.12.0 source so I can attach it to my debugger? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668111.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket error page runs twice
http://central.maven.org/maven2/org/apache/wicket/wicket-core/6.12.0/wicket-core-6.12.0-sources.jar Hint: org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Oct 27, 2014 at 2:20 PM, Entropy blmulholl...@gmail.com wrote: Well, you are definitely right that there are multiple requests for whatever reason. I can see WicketServlet doPost called, the method runs, throws the error, the error page gets control with the exception, then a doGet occurs and the error page runs again without the exception. I can't really see the details as I don't have the source for Wicket 6.12.0. I went to http://www.apache.org/dyn/closer.cgi/wicket/6.12.0 and none of the links work. Where can I download 6.12.0 source so I can attach it to my debugger? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668111.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket error page runs twice
Okay, I found this, the first request URL and query string are: /EquitableSharing/?19-1.IBehaviorListener.1-share-form-toolContainer-declineSharingButton The second is: /EquitableSharing/wicket/bookmarkable/gov.usdoj.afms.esp.application.ESPApplicationErrorPage So it seems like even though the error page RUNS in the first request, wicket is trying to redirect to it in order to make the URL bookmarkable. Of course, nobody wants a bookmarkable error page, that would just be silly. So I must be triggering this behavior by accident somewhere. The error page itself just extends WebPage. In the app init, the error page is set up like so: // set the error page IApplicationSettings settings = getApplicationSettings(); settings.setInternalErrorPage(ESPApplicationErrorPage.class); this.getRequestCycleListeners().add(new AbstractRequestCycleListener(){ public IRequestHandler onException(RequestCycle cycle, Exception ex) { cycle.setMetaData(EXCEPTION_KEY, ex); return null; //cycle.getRequestHandlerScheduledAfterCurrent(); } }); getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); We have some calls to mountPage in the app init, but the error page is not involved. Where is this behavior coming from I wonder? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668113.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket error page runs twice
On Mon, Oct 27, 2014 at 2:35 PM, Entropy blmulholl...@gmail.com wrote: Okay, I found this, the first request URL and query string are: /EquitableSharing/?19-1.IBehaviorListener.1-share-form-toolContainer-declineSharingButton The second is: /EquitableSharing/wicket/bookmarkable/gov.usdoj.afms.esp.application.ESPApplicationErrorPage So it seems like even though the error page RUNS in the first request, wicket is trying to redirect to it in order to make the URL bookmarkable. Of course, nobody wants a bookmarkable error page, that would just be silly. So I must be triggering this behavior by accident somewhere. The error page itself just extends WebPage. In the app init, the error page is set up like so: // set the error page IApplicationSettings settings = getApplicationSettings(); settings.setInternalErrorPage(ESPApplicationErrorPage.class); this.getRequestCycleListeners().add(new AbstractRequestCycleListener(){ public IRequestHandler onException(RequestCycle cycle, Exception ex) { cycle.setMetaData(EXCEPTION_KEY, ex); return null; //cycle.getRequestHandlerScheduledAfterCurrent(); instead: return new RenderPageRequestHandler(new ESPApplicationErrorPage(ex)); } }); getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); We have some calls to mountPage in the app init, but the error page is not involved. Where is this behavior coming from I wonder? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668113.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket error page runs twice
With a slight modification, that worked. I used: return new RenderPageRequestHandler(new PageProvider(new ESPApplicationErrorPage(ex))); Thanks Martin! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-error-page-runs-twice-tp4668093p4668115.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: jquery DataTable + wicket Cannot bind a listener
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 of mode in wicket possibly that would preserve the listeners in this way? Thanks, Jason On 10/26/14, 11:40 PM, Martin Grigorov wrote: 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 26, 2014 at 12:46 AM, Jason Novotny jason.novo...@gmail.com wrote: 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: Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-0-detailsLink,e:click,c: detailsLinkff});; Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-1-detailsLink,e:click,c: detailsLink100});; Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-2-detailsLink,e:click,c: detailsLink101});; Wicket.Ajax.ajax({u:./executed?7-1.IBehaviorListener.0-container- executedTransactionPanel-executedListView-3-detailsLink,e:click,c: detailsLink102});; ... If the table has 2 pages, it removes the DOM elements from the 2nd page so I get the wicket debug error Wicket.Ajax: Cannot bind a listener for event click on element elementId because the element is not in the DOM Now when I hit the link for next page of the table, the DOM has been updated to reflect the rows, but the javascript events need to be added again and so the links are broken. Is there any good way to do this? Thanks, Jason On 10/24/14, 1:24 PM, Jason Novotny wrote: 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({ 'lengthChange': false, 'dom': 'topdoc-filterholdeript', language: {info: _START_-_END_ of _TOTAL_}, aaSorting: [], 'iDisplayLength': 12 }); }); It all looks good, however because one of my columns contains AjaxLinks, I get an error from my wicket debug window with the following: Wicket.Ajax: Cannot bind a listener for event click on element elementId because the element is not in the DOM The thing is the links seem to actually work on the first page, but when I click - to go to the next page the links don't work. Has anyone experienced this before or have any idea how I can debug this? Thanks, Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org