我需要一些关于js
从 javascript 调用函数的帮助。
我有一个 servlet 可以检查协议号是否null
存在。如果协议号不是null
那么它将在jsp中显示一个消息框。
Servlet 代码是 -
String agrno = request.getParameter("agrno");
System.out.println("agrno in checkcash =" + agrno);
sql = "select agrno from ColdStorage.RecieptMaster where agrno = ?";
prest = (PreparedStatement) conn.prepareStatement(sql);
prest.setString(1, agrno);
String agrid = "";
rs = prest.executeQuery();
while(rs.next())
{
agrid = rs.getString("agrno");
System.out.println("agrid = "+agrid);
}
if(agrid != null)
{
// javascript call should be here.
}
和javascript代码是:
Ext.widget('button', {
renderTo: Ext.getBody()
, text: 'Show Message'
, handler: function () {
Ext.Msg.show({
//title: '',
msg: 'Cash Receipt for specified Agreement number already exist, do you want to regenerate it? ',
buttonText: { yes: "YES", no: "NO"},
buttons: Ext.MessageBox.YESNO
});
}
});