ADF 中OnClick的JavaScript的支持问题

ADF 11g不再支持OnclickJavaScript,而是采用<af:clientListener>来实现诸如删除某条记录的提示框。

实现方式如下:

 

 function confirmDelete() { if (confirm('Are you sure you want to delete this record?')) return true; else return false; }


<af:commandLink actionListener="#{bindings.removeRowWithKey.execute}" action="#{viewCalStatus.deleteCalStatus}" text="Delete"> <af:clientListener method="confirmDelete" type="click"/> <af:setActionListener from="#{row.rowKeyStr}" to="#{requestScope.calStatusRow}"/> </af:commandLink>

 

 

 

ADF 中的<af:commandLink>和<af:commandButton>传递参数的方法

<af:commandLink id= “” text= “”><f:param name= “param_name” value= “param_value”/></ af:commandLink>  

 

 

评论:<af:commandLink>可以采用该方法传递参数,而<af:commandButton>不行。不过可以应用<h: commandButton >代替<af:commandButton>实现参数传递。

具体方法如下:

 

<h:commandButton value="更新" action="#{emplBean.edit_action}" id="cb1"> <input type="hidden" name="emplId" value="${emplBean.employee.empno}"/></h:commandButton>  

你可能感兴趣的:(JavaScript,function,delete,input,action)