我有以下代码:
<p:remoteCommand name="navigateTo" actionListener="#{searchControllerHelper.dummyActionListener}"
action="#{searchControllerHelper.navigateTo}" update="searchPanelForm"
onstart="plsWaitDlg.show()" onsuccess="plsWaitDlg.hide()"/>
控制器代码如下: 谢谢Lars。 bean的代码如下:
public String navigateTo() throws FetchException {
if (null == this.getSelectedMenuLink()) {
return null;
}
if (this.getSelectedMenuLink().longValue() == 1L) {
this.prevSelectedMenuLink = this.selectedMenuLink;
this.location = null;
return searchCRE();
}
else if (this.getSelectedMenuLink().longValue() == 2L) {
this.prevSelectedMenuLink = this.selectedMenuLink;
this.selectedLoanType=null;
return searchLoans();
}
else if (this.getSelectedMenuLink().longValue() == 3L) {
this.prevSelectedMenuLink = this.selectedMenuLink;
this.selectedLoanType=null;
return searchLoans();
}
else if (this.getSelectedMenuLink().longValue() == 4L) {
this.prevSelectedMenuLink = this.selectedMenuLink;
return otherOpportunities();
}
else if (this.getSelectedMenuLink().longValue() == 5L) {
//The link needs to be 'activated' once a service provider is selected.
this.prevSelectedMenuLink= this.selectedMenuLink;
return this.navigateToHome();
}
return null;
}
我添加了actionlistener以检查控制器是否被触发,它是。
正在发生的事情如下:页面加载,在完成加载之前,如果用户单击调用此remoteCommand的按钮,那么奇怪的是actionListener被调用,但action方法没有。
我可以采取哪些措施来缓解这个问题?
谢谢 KARTHIK