Re: Sortable, with Selectable; Exception evaluating javascript: TypeError: undefined is not a function
Hi Chris, AFAIS, the only thing that I think it could typically cause an issue is calcHeight(). But the error message is misleading, I would have expect a calcHeight is undefined instead, so I am not really sure... Furthermore, I don't know how/where you have included the calcHeight function. If the scope is window then try window.calcHeight(); If it does not solve the issue or you suspect it comes from elsewhere please create a minimal quickstart that reproduce the issue and I will have a look... Thanks best regards, Sebastien. (function(){Wicket.Ajax.ajax({sc:voteup,c:voteup47,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-voteup,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedown48,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-votedown,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({c:thumbTitleLink49,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-thumbTitleLink,e:click});})(); (function(){Wicket.Ajax.ajax({c:remove4a,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-remove,e:click});})(); (function(){Wicket.Ajax.ajax({c:position4b,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-position,e:click});})(); (function(){Wicket.Ajax.ajax({c:poiItem4c,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem,e:click});})(); (function(){Wicket.Ajax.ajax({sc:voteup,c:voteupab,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-voteup,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedownac,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-votedown,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({c:shuffleae,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-flickrGallery-shuffle,e:click});})(); (function(){ calcHeight();})(); (function(){Wicket.Ajax.ajax({c:deleteAll,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-deleteAll,e:click});})(); (function(){ jQuery('#sortable2c').sortable({ update: function (event,ui) { var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-sortable}; var params = {'hash': ui.item.data('hash'),'index': ui.item.index()}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } , handle: .handle }); })(); (function(){ jQuery('#sortable2c').selectable({ cancel: span, filter: li, stop: function () { var indexes=[]; jQuery('.ui-selected', this).each( function() { indexes.push(jQuery('#sortable2c li').index(this)); } ); var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.1-suitcasePanel-container-sortable}; var params = {'indexes': indexes}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } }); })(); On Sun, Apr 26, 2015 at 2:08 AM, Chris chris...@gmx.at wrote: Hi Sebastian, I would like to render the container with the sortable items based on a Wicket event: @Override public void onEvent(IEvent? event) { super.onEvent(event); if (event.getPayload() instanceof AddItem) { update.getTarget().add(container); } } Thereby, I am getting following error. Has this something to do that some JS file has to be referenced in the panel instead of page? Thanks a lot, Chris ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: TypeError: undefined is not a function (evaluating 'jQuery('#sortable2c').sortable'), text:
Re: Sortable, with Selectable; Exception evaluating javascript: TypeError: undefined is not a function
Sebastian, thank you for your answer! Chris Am 26.04.2015 um 20:38 schrieb Sebastien seb...@gmail.com: Hi Chris, Yes wicket includes it on demand (when it need it, like with wicket events). If you need to add a custom javascript, I recommend you to do it through a JQueryPluginResourceReference, so underlying jquery library will be automatically loaded when you use it... For instance, in #renderHead: ResourceReference reference = new JQueryPluginResourceReference(MyComponent.class, myjavascript.js); response.render(JavaScriptHeaderItem.forReference(reference)); Best regards, Sebastien. On Sun, Apr 26, 2015 at 8:13 PM, Chris chris...@gmx.at wrote: Hi Sebastian, I just did this - but nevertheless, if I do not include the same version in wicket:head, $(function () is not called in html head. Does Wicket include it only for internal purposes, but not automatically for JS placed in HTML? Thanks, Chris Am 26.04.2015 um 19:33 schrieb Sebastien seb...@gmail.com: Hi Chris, You cannot have 2 concurrent versions of jquery... If you need to upgrade jquery version, please use: this.getJavaScriptLibrarySettings().setJQueryReference(jQueryReference) - in MyApplication#init() Hope this helps, Sebastien On Sun, Apr 26, 2015 at 7:14 PM, Chris chris...@gmx.at wrote: Hi Sebastian, thanks for your help. the reason for this error seems that I load jquery-1.11.2.min.js in wicket head next to jQuery-1.11.1 which is already loaded via wicket. However, when I restrain from loading jquery-1.11.2.min.js in wicket head , the javascript $(function () {…} is not called although jQuery-1.11.1 seems to be loaded (via wicket). Why does this happen? Thanks Chris Am 26.04.2015 um 18:02 schrieb Sebastien seb...@gmail.com: Hi Chris, AFAIS, the only thing that I think it could typically cause an issue is calcHeight(). But the error message is misleading, I would have expect a calcHeight is undefined instead, so I am not really sure... Furthermore, I don't know how/where you have included the calcHeight function. If the scope is window then try window.calcHeight(); If it does not solve the issue or you suspect it comes from elsewhere please create a minimal quickstart that reproduce the issue and I will have a look... Thanks best regards, Sebastien. (function(){Wicket.Ajax.ajax({sc:voteup,c:voteup47,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-voteup,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedown48,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-votedown,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({c:thumbTitleLink49,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-thumbTitleLink,e:click});})(); (function(){Wicket.Ajax.ajax({c:remove4a,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-remove,e:click});})(); (function(){Wicket.Ajax.ajax({c:position4b,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-position,e:click});})(); (function(){Wicket.Ajax.ajax({c:poiItem4c,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem,e:click});})(); (function(){Wicket.Ajax.ajax({sc:voteup,c:voteupab,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-voteup,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedownac,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-votedown,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({c:shuffleae,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-flickrGallery-shuffle,e:click});})(); (function(){ calcHeight();})(); (function(){Wicket.Ajax.ajax({c:deleteAll,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-deleteAll,e:click});})(); (function(){ jQuery('#sortable2c').sortable({ update: function (event,ui) { var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-sortable}; var params = {'hash': ui.item.data('hash'),'index': ui.item.index()}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } , handle: .handle }); })(); (function(){ jQuery('#sortable2c').selectable({ cancel: span, filter: li, stop: function () { var indexes=[]; jQuery('.ui-selected', this).each( function() { indexes.push(jQuery('#sortable2c li').index(this)); } ); var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.1-suitcasePanel-container-sortable}; var params = {'indexes': indexes}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } }); })(); On Sun, Apr 26, 2015 at 2:08 AM, Chris chris...@gmx.at wrote: Hi Sebastian, I would like to render the container with the sortable items based on a Wicket event: @Override public
Re: Sortable, with Selectable; Exception evaluating javascript: TypeError: undefined is not a function
Hi Sebastian, thanks for your help. the reason for this error seems that I load jquery-1.11.2.min.js in wicket head next to jQuery-1.11.1 which is already loaded via wicket. However, when I restrain from loading jquery-1.11.2.min.js in wicket head , the javascript $(function () {…} is not called although jQuery-1.11.1 seems to be loaded (via wicket). Why does this happen? Thanks Chris Am 26.04.2015 um 18:02 schrieb Sebastien seb...@gmail.com: Hi Chris, AFAIS, the only thing that I think it could typically cause an issue is calcHeight(). But the error message is misleading, I would have expect a calcHeight is undefined instead, so I am not really sure... Furthermore, I don't know how/where you have included the calcHeight function. If the scope is window then try window.calcHeight(); If it does not solve the issue or you suspect it comes from elsewhere please create a minimal quickstart that reproduce the issue and I will have a look... Thanks best regards, Sebastien. (function(){Wicket.Ajax.ajax({sc:voteup,c:voteup47,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-voteup,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedown48,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-votedown,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({c:thumbTitleLink49,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-thumbTitleLink,e:click});})(); (function(){Wicket.Ajax.ajax({c:remove4a,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-remove,e:click});})(); (function(){Wicket.Ajax.ajax({c:position4b,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-position,e:click});})(); (function(){Wicket.Ajax.ajax({c:poiItem4c,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem,e:click});})(); (function(){Wicket.Ajax.ajax({sc:voteup,c:voteupab,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-voteup,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedownac,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-votedown,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({c:shuffleae,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-flickrGallery-shuffle,e:click});})(); (function(){ calcHeight();})(); (function(){Wicket.Ajax.ajax({c:deleteAll,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-deleteAll,e:click});})(); (function(){ jQuery('#sortable2c').sortable({ update: function (event,ui) { var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-sortable}; var params = {'hash': ui.item.data('hash'),'index': ui.item.index()}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } , handle: .handle }); })(); (function(){ jQuery('#sortable2c').selectable({ cancel: span, filter: li, stop: function () { var indexes=[]; jQuery('.ui-selected', this).each( function() { indexes.push(jQuery('#sortable2c li').index(this)); } ); var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.1-suitcasePanel-container-sortable}; var params = {'indexes': indexes}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } }); })(); On Sun, Apr 26, 2015 at 2:08 AM, Chris chris...@gmx.at wrote: Hi Sebastian, I would like to render the container with the sortable items based on a Wicket event: @Override public void onEvent(IEvent? event) { super.onEvent(event); if (event.getPayload() instanceof AddItem) { update.getTarget().add(container); } } Thereby, I am getting following error. Has this something to do that some JS file has to be referenced in the panel instead of page? Thanks a lot, Chris ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: TypeError: undefined is not a function (evaluating 'jQuery('#sortable2c').sortable'), text:
Re: Sortable, with Selectable; Exception evaluating javascript: TypeError: undefined is not a function
Hi Chris, Yes wicket includes it on demand (when it need it, like with wicket events). If you need to add a custom javascript, I recommend you to do it through a JQueryPluginResourceReference, so underlying jquery library will be automatically loaded when you use it... For instance, in #renderHead: ResourceReference reference = new JQueryPluginResourceReference(MyComponent.class, myjavascript.js); response.render(JavaScriptHeaderItem.forReference(reference)); Best regards, Sebastien. On Sun, Apr 26, 2015 at 8:13 PM, Chris chris...@gmx.at wrote: Hi Sebastian, I just did this - but nevertheless, if I do not include the same version in wicket:head, $(function () is not called in html head. Does Wicket include it only for internal purposes, but not automatically for JS placed in HTML? Thanks, Chris Am 26.04.2015 um 19:33 schrieb Sebastien seb...@gmail.com: Hi Chris, You cannot have 2 concurrent versions of jquery... If you need to upgrade jquery version, please use: this.getJavaScriptLibrarySettings().setJQueryReference(jQueryReference) - in MyApplication#init() Hope this helps, Sebastien On Sun, Apr 26, 2015 at 7:14 PM, Chris chris...@gmx.at wrote: Hi Sebastian, thanks for your help. the reason for this error seems that I load jquery-1.11.2.min.js in wicket head next to jQuery-1.11.1 which is already loaded via wicket. However, when I restrain from loading jquery-1.11.2.min.js in wicket head , the javascript $(function () {…} is not called although jQuery-1.11.1 seems to be loaded (via wicket). Why does this happen? Thanks Chris Am 26.04.2015 um 18:02 schrieb Sebastien seb...@gmail.com: Hi Chris, AFAIS, the only thing that I think it could typically cause an issue is calcHeight(). But the error message is misleading, I would have expect a calcHeight is undefined instead, so I am not really sure... Furthermore, I don't know how/where you have included the calcHeight function. If the scope is window then try window.calcHeight(); If it does not solve the issue or you suspect it comes from elsewhere please create a minimal quickstart that reproduce the issue and I will have a look... Thanks best regards, Sebastien. (function(){Wicket.Ajax.ajax({sc:voteup,c:voteup47,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-voteup,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedown48,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-votedown,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({c:thumbTitleLink49,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-thumbTitleLink,e:click});})(); (function(){Wicket.Ajax.ajax({c:remove4a,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-remove,e:click});})(); (function(){Wicket.Ajax.ajax({c:position4b,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-position,e:click});})(); (function(){Wicket.Ajax.ajax({c:poiItem4c,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem,e:click});})(); (function(){Wicket.Ajax.ajax({sc:voteup,c:voteupab,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-voteup,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedownac,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-votedown,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({c:shuffleae,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-flickrGallery-shuffle,e:click});})(); (function(){ calcHeight();})(); (function(){Wicket.Ajax.ajax({c:deleteAll,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-deleteAll,e:click});})(); (function(){ jQuery('#sortable2c').sortable({ update: function (event,ui) { var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-sortable}; var params = {'hash': ui.item.data('hash'),'index': ui.item.index()}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } , handle: .handle }); })(); (function(){ jQuery('#sortable2c').selectable({ cancel: span, filter: li, stop: function () { var indexes=[]; jQuery('.ui-selected', this).each( function() { indexes.push(jQuery('#sortable2c li').index(this)); } ); var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.1-suitcasePanel-container-sortable}; var params = {'indexes': indexes}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } }); })(); On Sun, Apr 26, 2015 at 2:08 AM, Chris chris...@gmx.at wrote: Hi Sebastian, I would like to render the container with the sortable items based on a Wicket event: @Override public void onEvent(IEvent? event) {
Re: Sortable, with Selectable; Exception evaluating javascript: TypeError: undefined is not a function
Hi Chris, You cannot have 2 concurrent versions of jquery... If you need to upgrade jquery version, please use: this.getJavaScriptLibrarySettings().setJQueryReference(jQueryReference) - in MyApplication#init() Hope this helps, Sebastien On Sun, Apr 26, 2015 at 7:14 PM, Chris chris...@gmx.at wrote: Hi Sebastian, thanks for your help. the reason for this error seems that I load jquery-1.11.2.min.js in wicket head next to jQuery-1.11.1 which is already loaded via wicket. However, when I restrain from loading jquery-1.11.2.min.js in wicket head , the javascript $(function () {…} is not called although jQuery-1.11.1 seems to be loaded (via wicket). Why does this happen? Thanks Chris Am 26.04.2015 um 18:02 schrieb Sebastien seb...@gmail.com: Hi Chris, AFAIS, the only thing that I think it could typically cause an issue is calcHeight(). But the error message is misleading, I would have expect a calcHeight is undefined instead, so I am not really sure... Furthermore, I don't know how/where you have included the calcHeight function. If the scope is window then try window.calcHeight(); If it does not solve the issue or you suspect it comes from elsewhere please create a minimal quickstart that reproduce the issue and I will have a look... Thanks best regards, Sebastien. (function(){Wicket.Ajax.ajax({sc:voteup,c:voteup47,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-voteup,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedown48,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-votedown,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({c:thumbTitleLink49,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-thumbTitleLink,e:click});})(); (function(){Wicket.Ajax.ajax({c:remove4a,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-remove,e:click});})(); (function(){Wicket.Ajax.ajax({c:position4b,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-position,e:click});})(); (function(){Wicket.Ajax.ajax({c:poiItem4c,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem,e:click});})(); (function(){Wicket.Ajax.ajax({sc:voteup,c:voteupab,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-voteup,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedownac,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-votedown,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({c:shuffleae,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-flickrGallery-shuffle,e:click});})(); (function(){ calcHeight();})(); (function(){Wicket.Ajax.ajax({c:deleteAll,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-deleteAll,e:click});})(); (function(){ jQuery('#sortable2c').sortable({ update: function (event,ui) { var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-sortable}; var params = {'hash': ui.item.data('hash'),'index': ui.item.index()}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } , handle: .handle }); })(); (function(){ jQuery('#sortable2c').selectable({ cancel: span, filter: li, stop: function () { var indexes=[]; jQuery('.ui-selected', this).each( function() { indexes.push(jQuery('#sortable2c li').index(this)); } ); var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.1-suitcasePanel-container-sortable}; var params = {'indexes': indexes}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } }); })(); On Sun, Apr 26, 2015 at 2:08 AM, Chris chris...@gmx.at wrote: Hi Sebastian, I would like to render the container with the sortable items based on a Wicket event: @Override public void onEvent(IEvent? event) { super.onEvent(event); if (event.getPayload() instanceof AddItem) { update.getTarget().add(container); } } Thereby, I am getting following error. Has this something to do that some JS file has to be referenced in the panel instead of page? Thanks a lot, Chris ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: TypeError: undefined is not a function (evaluating 'jQuery('#sortable2c').sortable'), text:
Re: Sortable, with Selectable; Exception evaluating javascript: TypeError: undefined is not a function
Hi Sebastian, I just did this - but nevertheless, if I do not include the same version in wicket:head, $(function () is not called in html head. Does Wicket include it only for internal purposes, but not automatically for JS placed in HTML? Thanks, Chris Am 26.04.2015 um 19:33 schrieb Sebastien seb...@gmail.com: Hi Chris, You cannot have 2 concurrent versions of jquery... If you need to upgrade jquery version, please use: this.getJavaScriptLibrarySettings().setJQueryReference(jQueryReference) - in MyApplication#init() Hope this helps, Sebastien On Sun, Apr 26, 2015 at 7:14 PM, Chris chris...@gmx.at wrote: Hi Sebastian, thanks for your help. the reason for this error seems that I load jquery-1.11.2.min.js in wicket head next to jQuery-1.11.1 which is already loaded via wicket. However, when I restrain from loading jquery-1.11.2.min.js in wicket head , the javascript $(function () {…} is not called although jQuery-1.11.1 seems to be loaded (via wicket). Why does this happen? Thanks Chris Am 26.04.2015 um 18:02 schrieb Sebastien seb...@gmail.com: Hi Chris, AFAIS, the only thing that I think it could typically cause an issue is calcHeight(). But the error message is misleading, I would have expect a calcHeight is undefined instead, so I am not really sure... Furthermore, I don't know how/where you have included the calcHeight function. If the scope is window then try window.calcHeight(); If it does not solve the issue or you suspect it comes from elsewhere please create a minimal quickstart that reproduce the issue and I will have a look... Thanks best regards, Sebastien. (function(){Wicket.Ajax.ajax({sc:voteup,c:voteup47,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-voteup,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedown48,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-voting-form-votedown,e:click,f:form46,m:POST});})(); (function(){Wicket.Ajax.ajax({c:thumbTitleLink49,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-thumbTitleLink,e:click});})(); (function(){Wicket.Ajax.ajax({c:remove4a,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-remove,e:click});})(); (function(){Wicket.Ajax.ajax({c:position4b,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem-position,e:click});})(); (function(){Wicket.Ajax.ajax({c:poiItem4c,u:./rec?2-1.IBehaviorListener.0-poiList-poiItems-3-poiItemPanel-poiItem,e:click});})(); (function(){Wicket.Ajax.ajax({sc:voteup,c:voteupab,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-voteup,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({sc:votedown,c:votedownac,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-voting-form-votedown,e:click,f:formaa,m:POST});})(); (function(){Wicket.Ajax.ajax({c:shuffleae,u:./rec?2-1.IBehaviorListener.0-rightPanel-poiDetail-flickrGallery-shuffle,e:click});})(); (function(){ calcHeight();})(); (function(){Wicket.Ajax.ajax({c:deleteAll,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-deleteAll,e:click});})(); (function(){ jQuery('#sortable2c').sortable({ update: function (event,ui) { var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.0-suitcasePanel-container-sortable}; var params = {'hash': ui.item.data('hash'),'index': ui.item.index()}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } , handle: .handle }); })(); (function(){ jQuery('#sortable2c').selectable({ cancel: span, filter: li, stop: function () { var indexes=[]; jQuery('.ui-selected', this).each( function() { indexes.push(jQuery('#sortable2c li').index(this)); } ); var attrs = {c:sortable2c,u:./rec?2-1.IBehaviorListener.1-suitcasePanel-container-sortable}; var params = {'indexes': indexes}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } }); })(); On Sun, Apr 26, 2015 at 2:08 AM, Chris chris...@gmx.at wrote: Hi Sebastian, I would like to render the container with the sortable items based on a Wicket event: @Override public void onEvent(IEvent? event) { super.onEvent(event); if (event.getPayload() instanceof AddItem) { update.getTarget().add(container); } } Thereby, I am getting following error. Has this something to do that some JS file has to be referenced in the panel instead of page? Thanks a lot, Chris ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: TypeError: undefined is not a function (evaluating 'jQuery('#sortable2c').sortable'), text:
load JS after page refresh
Hi all, how is it possible to load a JS function after a specific page refresh based on an ajax link click? Link link = new AjaxFallbackLink(link) { @Override public void onClick(AjaxRequestTarget target) { target.add(getPage()); } }; Thanks, Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: load JS after page refresh
Hello, On the arrival page you can do it in renderHead. Isn't it good for you? chris.gr [via Apache Wicket] ml-node+s1842946n4670509...@n4.nabble.com ezt írta (időpont: 2015. ápr. 27., Hét 4:16): Hi all, how is it possible to load a JS function after a specific page refresh based on an ajax link click? Link link = new AjaxFallbackLink(link) { @Override public void onClick(AjaxRequestTarget target) { target.add(getPage()); } }; Thanks, Chris - To unsubscribe, e-mail: [hidden email] http:///user/SendEmail.jtp?type=nodenode=4670509i=0 For additional commands, e-mail: [hidden email] http:///user/SendEmail.jtp?type=nodenode=4670509i=1 -- If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/load-JS-after-page-refresh-tp4670509.html To start a new topic under Users forum, email ml-node+s1842946n1842947...@n4.nabble.com To unsubscribe from Users forum, click here http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842947code=a292YXJvbjFAZ21haWwuY29tfDE4NDI5NDd8MjY3OTE2NzY= . NAML http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/load-JS-after-page-refresh-tp4670509p4670510.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