2 Replies Latest reply on Oct 19, 2009 11:02 AM by juangon

    a4j:support doesn't call actionListener nested to rich:edito

    juangon

      Hi!

      I have a problem, which I couldn't found a solution after searching for a while...

      I have a rich:editor with a nested a4j:support with onchange event:

      <rich:editor id="reportEditor" theme="advanced" plugins="fullscreen,media" value="#{reportBean.report.reportText}"
      height="410" configuration="#{configBean.editorConfig}">
       <a4j:support id="reportOnchange" event="onchange" reRender="reportOnchange" ajaxSingle="true" immediate="true" disabled="#{!reportBean.report.modified}"
       actionListener="#{reportsController.reportModified}" />
       <f:validateLength maximum="80000" minimum="10" />
      </rich:editor>


      Don't know why, but the actionListener is not called. If I add valuechangeListener attribute to rich:editor seems to work fine, but I cannot do like that because I want to disable the onchange event when the report isn't modified (for example, when user saves the report), and don't want to reRender the whole rich:editor, because I would like to make it transparently to user (only would reRender the a4j:a4j:support to disable the event).

      Thanks very much in advance!


        • 1. Re: a4j:support doesn't call actionListener nested to rich:e
          ilya_shaikovsky

          reportBean scope?

          • 2. Re: a4j:support doesn't call actionListener nested to rich:e
            juangon

            Hi ilya!

            Thanks for your quick answer.

            The reportBean was request scope, but was kept alive with a4j:keepAlive.

            I finally got it working changing the nested tags order (a4j:support and f:validateLength) like this:

            <rich:editor id="reportEditor" theme="advanced" plugins="fullscreen,media" value="#{reportBean.report.reportText}"
            height="410" configuration="#{configBean.editorConfig}">
             <f:validateLength maximum="80000" minimum="10" />
             <a4j:support event="onchange" reRender="reportOnchange" ajaxSingle="true" disabled="#{!reportBean.report.modified}"
             actionListener="#{reportsController.reportModified}" />
            
            </rich:editor>


            I removed the immediate attribute in a4j:support too, but I don't think that was the problem..

            Thanks for your help again!