This code doesn't use Wicket.Ajax JavaScript APIs so the Ajax Channels are not involved at all.
Please show us the Java code of the servlet. How does it use the page ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Apr 21, 2016 at 10:38 PM, fachhoch <[email protected]> wrote: > This is the javascript file rendered by wicket page, this opens a > connection to the async servlet, page has several ajax links, clicking on > ajaxlinks updates dom, and sometimes wicket throws > ComponentNotFoundException. > Initially tried calling MessagePanel.longPoll(data) from wicket page with > OnDomReadyHeaderItem, no success, then try selfinvoking function assuming > will work but the same exception. > > > (function MessagePanelPolling (){ > $.ajax({ > url: "/myapp/app/user/userId", > success: function(data){ > if(data){ > MessagePanel.longPoll(data); > } > }, > type: "GET", > data: {timestamp: new Date().getTime()} > }); > })(); > > var MessagePanel ={ > cancelPolling:null, > newMsg:function(){ > var markup='<div> You have a new message </div>' > var my_dialog =$(markup).dialog({ > position:'right top' > ,title:'New Message' > }); > my_dialog.dialog('widget').zIndex(25000); > } > ,longPoll:function(channel){ > $.ajax({ > url: "/myapp/cometmsg", > success: function(data){ > if(data){ > > if('new_message'===data.trim()){ > > MessagePanel.newMsg(); > } > } > }, > error: function(err) { > MessagePanel.cancelPolling='true'; > console.log(" long poll error > "+err); > }, > type: "GET", > data: {name:channel,timestamp: new > Date().getTime()} > ,complete:function(){ > > if(MessagePanel.cancelPolling!='true'){ > > MessagePanel.longPoll(channel) > } > } > }); > } > } > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/open-connection-to-async-servlet-and-initiate-wicket-ajax-request-results-ComponentNotFoundException-tp4674357p4674359.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
