小编Ark*_*uri的帖子

commandLink不会调用动作侦听器,但commandButton可以正常工作

我想通过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>.这是怎么造成的,我该如何解决?

commandlink jsf-2

5
推荐指数
1
解决办法
7568
查看次数

标签 统计

commandlink ×1

jsf-2 ×1