Saikat
Saikat

Reputation: 558

JSF Managed bean methods not getting called

We are currently developing a JSF 2 application and we are using OpenFaces.

One "intermittent" issue that we have been noticing is that the managed bean method "sometimes" doesn't get called.

For example:

<o:commandLink onclick="wait();" action="#{createAccountContractManagedBean.executeSave}"
    execute="panGrp_createAccountContractMainTabLocal"
    render="panGrp_createAccountContractLocalErrorMessages label_contractNumber pnlGrp_editCustomerGroup"  
    styleClass="buttonOrange" 
    onajaxend="wait();setTabFocus('inpHdn_contractErr','tabPane_MainLocal',3);return false;">
    <span>
        <h:outputLabel value="#{message['application.common.button.saveandcontinue']}"/>
    </span>
</o:commandLink>

wait() is a javascript function that show a modal dialog that the request is currently in process.

setTabFocus() is a javascript function that sets the focus onto a new tab if the current save request is successful.

public void executeSave() {
    if (getLoggingService().isDebugLevelEnable()) {
        getLoggingService().debug(this, "executeSave");
    }

    // ...
}

The issue is that sometimes the managed bean method executeSave() doesn't fire at all. No log message or error.

But at the same time the onajaxend() method always fires and since there is no error, it switches the focus to the next tab.

We have tried by removing the wait(); and the setTabFocus(); methods.

All the components are in the same <h:form> element and there are no multiple forms.

  1. What might be the possible causes when a managed bean method doesn't execute with no error trace?

  2. May mixing JSF <h:xxx> components and <o:xxx> components in the same form cause problems?

  3. Does mixing <o:ajax> and <f:ajax> cause problems?

  4. Is there a possibility that on a complex form with many OpenFaces popups, that the ajax functionality might misbehave?

Upvotes: 1

Views: 1736

Answers (1)

Dmitry Kashcheiev
Dmitry Kashcheiev

Reputation: 92

What might be the possible causes when a managed bean method doesn't execute with no error trace?

You could try to turn ON logging like it described here. Also you could take a look with some browser debugger tool to the ajax response from server, it probably could contain some error information.

May mixing JSF components and components in the same form cause problems?

No, in common OF have full compatibility with JSF. In some really complicated cases you could get some problems, but I don't think that the situation you've described one of them.

does mixing and cause problems?

It's normal to mix them.

Is there a possibility that on a complex form with many OpenFaces popups, that the ajax functionality might misbehave?

Of course it possible that there are some bugs in OF or even JSF, but usually you will get at list some error information in such situation. Also you could try to update to latest nightly build. Or post you problem to OF support forum.

Upvotes: 0

Related Questions