如何在jsf中打开一个弹出窗口

时间:2010-10-28 11:24:17

标签: jsf

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 %>')"/>

1 个答案:

答案 0 :(得分:2)

要在用户点击按钮时调用Javascript函数,您必须在onclick属性中添加Javascript代码:

<h:commandButton onclick="editGroup(...);" .../>