tags:

views:

19

answers:

1
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 code :

      <h:commandButton id="mod" styleClass="button" value="#{msg.btnmodify}"                   onclick="javascript:return editGroup('<%=list[0] %>','<%= type %>','<%=machineId %>')"/>
+1  A: 

To call a Javascript function when the user clicks on a button, you have to add the Javascript code in the onclick attribute:

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