Javacsript module problem

Erich Gormann <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <[email protected]>
Dear all,

 From a java class I load a js module and try to invoke a method in it 
using the following line:

javaScriptSupport.require("hotel/loadingIndicatorTrigger").invoke("showLoadingIndicator");

The script file loadingIndicatorTrigger.js is in 
src/main/resources/META-INF/modules/hotel/loadingIndicatorTrigger.js

This is the content of the script:
requirejs.config({
"shim": {
"hotel/globals/jquery.loading.indicator": {
deps: ["jquery"]
}
}
});

define(["hotel/globals/jquery.loading.indicator"], function() {

function showLoadingIndicator() {
var homeLoader = jQuery('body').loadingIndicator({
useImage: false,
}).data("loadingIndicator");
homeLoader.show();
}

});

Now the browser console prompts always the following error: "RequireJS 
error: require: moduleLib is undefined".

In my Eclipse I see a warning in above line of java code: "Couldn’t 
resolve classpath asset from path 
META-INF\modules\hotel\loadingIndicatorTrigger.js"

I tried different things like
define(["jquery", "hotel/globals/jquery.loading.indicator"], function($) {
buterror is always the same.

Is there something missing in my configuration or in the applications 
module class?

Thanks for your help!


Regards, Erich





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.