primefaces remoteCommand action is not getting called

1.4k Views Asked by At

I have the following code:

<p:remoteCommand name="navigateTo" actionListener="#{searchControllerHelper.dummyActionListener}" 
    action="#{searchControllerHelper.navigateTo}" update="searchPanelForm" 
    onstart="plsWaitDlg.show()" onsuccess="plsWaitDlg.hide()"/>

Controller Code as under: Thank you Lars. Code of the bean as under:

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;
}

I added the actionlistener to check if the controller was getting fired or not, and it is.

What is happening is the following: The page loads, and before it is completely done loading if the user clicks the button that calls this remoteCommand then strangely the actionListener gets called, but the action method does not.

Any ideas what I could do to alleviate this issue?

Thank you Karthik

0

There are 0 best solutions below