function editGroup(group_reason_id,type,mdVal)
{
alert("test==>"+group_reason_id);
window.open("addgroup_reason.jsp?am=m&t="+type+"&md="+mdVal+"&gr="+group_reason_id,"","toolbar=no,resizable=no,status=no,menubar=no,scrollbars=yes,width=800,height=400,top=145,left=235") ;
return true;
}
JSF代码:
<h:commandButton id="mod" styleClass="button" value="#{msg.btnmodify}" onclick="javascript:return editGroup('<%=list[0] %>','<%= type %>','<%=machineId %>')"/>
答案 0 :(得分:2)
要在用户点击按钮时调用Javascript函数,您必须在onclick
属性中添加Javascript代码:
<h:commandButton onclick="editGroup(...);" .../>