Preface: DWZ default provides information level output of error, success, timeout, that is, when you submit information to the server, the foreground page can provide a popup theme for the above three, but sometimes we need to prompt the user a message, neither error, Is not success, we need info, tell the user just, then we need to make some modifications.
First, add the following code to the Baseconroller.java
Protected Modelandview ajaxdoneinfo (String message) { return Ajaxdone (201, message, "");}
Next, call the location where you want to output info
return Ajaxdoneinfo (msg);
then, the front desk of the dwz.core.js need to change the content
PageInfo: {pagenum: "Pagenum", Numperpage: "Numperpage", OrderField: "OrderField", Orderdirection: "Orderdirection"}, StatusCode: {ok:200, error:300, timeout:301, info:201}, keys: {statusCode: ' StatusCode ', message: ' Message '},
Ajaxdone:function (JSON) { if (json[dwz.keys.statuscode] = = DWZ.statusCode.error) { if (json[dwz.keys.message ] && alertmsg) alertmsg.error (Json[dwz.keys.message]); } else if (json[dwz.keys.statuscode] = = DWZ.statusCode.timeout) { if (alertmsg) Alertmsg.error (json[ DWZ.keys.message] | | Dwz.msg ("Sessiontimout"), {okCall:DWZ.loadLogin}); else Dwz.loadlogin (); } else if (json[dwz.keys.statuscode] = = DWZ.statusCode.ok) { if (Json[dwz.keys.message] && alertmsg) Alertmsg.correct (Json[dwz.keys.message]); } else if (json[dwz.keys.statuscode] = = DWZ.statusCode.info) { if (Json[dwz.keys.message] && alertmsg) Alertmsg.info (Json[dwz.keys.message]); }; },
Finally, change the following in the Dwz.ajax.js file
* {"StatusCode": "301", "message": "Session Timeout"} * {"StatusCode": "201", "message": "INFO Hint"} * */function Navtabajaxdone (JSON) { Dwz.ajaxdone (JSON); if (json[dwz.keys.statuscode] = = DWZ.statusCode.ok | | json[dwz.keys.statuscode] = = DWZ.statusCode.info) { if ( Json.navtabid) {//mark the specified Navtab page as requiring "reload". Note that Navtabid cannot be the current Navtab page
function Dialogajaxdone (JSON) {dwz.ajaxdone (JSON); if (json[dwz.keys.statuscode] = = DWZ.statusCode.ok | | json[ DWZ.keys.statusCode] = = DWZ.statusCode.info) {
Add the following to the one more thing,index.jsp file
StatusCode: { ok:200, error:300, timeout:301, info:201 },//"optional"
Summary: Finally, remember to refresh the page cache, otherwise, you may not see the effect you changed, OK, see.
DWZ: page adds info pop-level info