When selecting a unit, the system dynamically associates the personnel information (menu interaction display information) and personnel Interaction
Use the onchange attribute on the jsp page to call the following method:
Write in script:
FunctionFromid (){
VarFrom_id = $ ("# from_id"). val ();
VarAddurl = "& from_id =" + from_id;
$. Ajax ({
Url: <select: link page = "/YYrequireplan. do? Method = fromid "/> + addurl,
Type: "get ",
DataType: "json ",
Success:Function(Html ){
Document. getElementById ("link_man"). value = html [0]. linkman;
Document. getElementById ("link_tel"). value = html [0]. tel;
Document. getElementById ("fax"). value = html [0]. fax;
}
});
}
// Backend call Method
Public VoidFromid (ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)ThrowsException {
String from_id = request. getParameter ("from_id ");
SqlRuturn ret;
List list =Null;
Try{
Ret = Executer.GetInstance(). ExecSeletSQL ("select trim (linkman) as linkman, trim (tel) as tel, trim (fax1) as fax from LO_SUPPLIERFACTORY where factoryid =" + from_id );
List = ret. getResultSet ();
}Catch(DbException e ){
E. printStackTrace ();
}
JSONArray jsonarray = JSONArray.FromObject(List );
PrintWriter out = response. getWriter ();
Out. print (jsonarray. toString ());
Out. close ();
}