For the XXX platform to implement a feature, use the check box settings on the Announcements pop-up page to no longer notify such announcements.
Principle: <input type= "checkbox" id= "Isselect" name= "Isselect" "value=" "onclick=" javascript:notips (); " />,checkbox the form is selected, the Struts2 action Isselect is ' 10 ', and no submit form isselect is null.
1.jsp page
<form id= "Form1" > <div class= "Jf_tanchu" > <div class= "jf_tanchutit" &G t;${bussinessnotice.noticetitle}</div> <div class= "Jf_tanchubox" > <div "class=" &
Gt Post type: <v:dcolor code= "${bussinessnotice.noticetype}"/> release time: <fmt:formatdate value = "${bussinessnotice.createdate}" pattern= "Yyyy-mm-dd"/> </div> ${bussinessnotice.noticeinfo} </d iv> </div> <s:if test= "bussinessnotice.noticetype== ' 25 ' | | bussinessnotice.noticetype== ' 63 ' | | bussinessnotice.noticetype== ' "> <div> <input type=" hidden "name=" Noticetype "value=" ${ Bussinessnotice.noticetype} "/> <input type=" checkbox "id=" Isselect "name=" Isselect "value=" ${ Bussinessnotice.noticetype} "onclick=" Javascript:notips (); /> <label for= "Isselect" > no longer notice such announcements </label> </div> </s:if> </form>
2.js Code
function Notips () {
var Formparam = $ ("#form1"). Serialize ()//Serialization table content is String
$.ajax ({
type: ' Post ',
URL : ' Notice_notipsnotice ',
Data:formparam,
cache:false,
dataType: ' json ',
success:function (data) {
}
});
}
3.NoticeAction Code
/** * checkbox does not prompt for notice, needs to modify the shielding status in the Tbussinessset, Ajax asynchronous request/public void Notipsnotice () {
try {printwriter out = This.getresponse (). Getwriter ();
Bussinessset = Bussinesssetservice.querybyid (GetUserID ());
String state = "";
if (isselect==null) {//noticetype==null does not check checkbox state = "11";
} else{state = "10";
} if (Noticetype) {bussinessset.setsaleback (state);
else if ("Noticetype") {Bussinessset.setremittancebank (state);
else if ("Noticetype") {bussinessset.setremittanceonline (state);
} bussinesssetservice.update (Bussinessset);
Out.print ("");
catch (Exception e) {log.error (E.fillinstacktrace ()); }
}