前台:
Außerdem unten aufgeführt :
<script type="text/javascript">
Funktion func_load_remark(sr_id){
if ( sr_id ! = 0 ) {
$.getJSON("loadSrRemark.do?date="+new Date(), {srid:sr_id}, function(srmain){
$("#bparemark").val(srmain.bpa_remark);
$("#itdremark").val(srmain.itd_remark);
$("#bugmark").val(srmain.bug_mark);
$("#itoremark").val(srmain.ito_remark);
});
}anders{
$("#bpairmark").val("");
$("#itdreammark").val("");
$("#bugmark").val("");
$("#itoremark").val("");
} }
} }
Funktionscheck(){
if($("#srid").val()=="0"){
Alert("Geben Sie SR_ID an!");
$("#srid").focus();
return false ;
} }
return true ;
} }
</script>
后台:
Außerdem unten aufgeführt :
Paket com.aegon_cnooc.oa.admin.action;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONSerializer;
import net.sf.json.util.JSONUTILS;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.aegon_cnooc.framework.base.action.BaseAction;
import com.aegon_cnooc.oa.admin.service.UserService;
import com.aegon_cnooc.oa.ibatis.to.TuOafSrMainTO;
Die öffentliche Klasse LoadSrRemarkAction erweitert BaseAction{
privater UserService userService;
public ActionForwardexecuteAction( ActionMapping-Zuordnung, ActionForward-Formular,
HttpServletRequest-Anfrage, HttpServletResponse-Antwort)
wirft eine Ausnahme {
String srid=request.getParameter("srid");
TuOafSrMainTO srMain=userService.getRemarkBySrId(srid);
Response.setContentType("application/json;charset=gbk");
Response.setCharacterEncoding("gbk");
PrintWriter pw = Response.getWriter();
pw.write(JSONUtils.valueToString(JSONSerializer.toJSON(srMain)));
pw.flush();
return null ;
} }
public void setUserService(UserService userService) {
this.userService = userService;
} }
} }