英文:
Jsf ajax not found in javascript file (jsf.ajax)
问题
Hello, it seems you are encountering an issue with your JavaScript code when using JSF. The error message "Uncaught ReferenceError: jsf is not defined" suggests that the 'jsf' object or variable is not recognized in your script.
This might be due to changes or differences in JSF versions or configurations. You may want to check your JSF setup and make sure that the 'jsf' object is accessible in your environment. Additionally, ensure that you have included the necessary JSF libraries or dependencies in your project.
If you have further questions or need assistance with resolving this issue, please feel free to ask.
英文:
Hello : I see that answer an I think I can use it in my code :Show loading progress when making JSF Ajax request
But when I use this method in javascript code :
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
jsf.ajax.addOnEvent(function (data) {
var ajaxstatus = data.status; // Can be "begin", "complete" and "success"
var ajaxloader = document.getElementById("ajaxloader");
switch (ajaxstatus) {
case "begin":
console.log("Begin");
break;
case "complete":
console.log("Completed");
break;
case "success":
console.log("Suc");
break;
}
});
<!-- end snippet -->
the console show me :
DpsMain.js:58 Uncaught ReferenceError: jsf is not defined
at DpsMain.js:58:1
Is that changed in JSF ?
or I missing something?
Versions :
GlassFish 7.0.3 Jakarta EE 10
JDK 17
The goal of my code is show loading entire the components and User View in safe way and easiest way! for minimum change in my codes or something else.
答案1
得分: 0
Ops , 我找到了!
在雅加达改名为 faces
所以我需要把 Jsf 改成 faces ,如下
faces.ajax.addOnEvent(function (data) {
var ajaxstatus = data.status; // 可以是 "begin", "complete" 和 "success"
var ajaxloader = document.getElementById("ajaxloader");
switch (ajaxstatus) {
case "begin":
console.log("开始");
break;
case "complete":
console.log("完成");
break;
case "success":
console.log("成功");
break;
}
});
现在它可以工作了!
如果问了一个愚蠢的问题,对不起。
英文:
Ops , I founded!
In jakarta changed name into faces
so I need to change Jsf into faces , Like blow
faces.ajax.addOnEvent(function (data) {
var ajaxstatus = data.status; // Can be "begin", "complete" and "success"
var ajaxloader = document.getElementById("ajaxloader");
switch (ajaxstatus) {
case "begin":
console.log("Begin");
break;
case "complete":
console.log("Completed");
break;
case "success":
console.log("Suc");
break;
}
});
now its work!
Sorry if asked a stupid question.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论