我想通过Facelets的链接调用一个方法:
我的Facelets代码如下:
<h:commandButton value="A" actionListener="#{customerData.searchedCustomerListA}" />
<h:commandLink value="A" actionListener="#{customerData.searchedCustomerListA}"/>
Run Code Online (Sandbox Code Playgroud)
支持bean代码如下:
public void searchedCustomerListA(ActionEvent ae){
customerName = "A";
leftCustomerListAvailable.clear();
if(customerDataBean.getSearchedCustomerList(customerName)!= null)
leftCustomerListAvailable =customerDataBean.getSearchedCustomerList("A");
}
Run Code Online (Sandbox Code Playgroud)
相同的代码正在起作用<h:commandButton>但不起作用<h:commandLink>.这是怎么造成的,我该如何解决?