4 Replies Latest reply on Mar 27, 2008 7:00 PM by sergeysmirnov

    a4j:keepAlive issue with facelets

    cagatay

      Hi,

      I try to use a4j:keepAlive as;

      <a4j:keepAlive beanName="#{myBean.valueToKeepAlive}"></a4j:keepAlive>

      But page doesn't open saying;

      com.sun.facelets.FaceletException: /somePage.xhtml @32,48 <a4j:keepAlive beanName="#{myBean.valueToKeepAlive}"> Must be literal

      I dont understand why it doesnt accept EL, any ideas?

      Libs I use are;
      MyFaces - 1.2.2
      Facelets 1.1.14
      RichFaces 3.1.14 GA

        • 1. Re: a4j:keepAlive issue with facelets
          cagatay

          Using as plain literal;

          <a4j:keepAlive beanName="myBean.valueToKeepAlive"></a4j:keepAlive>

          doesn't restore the value either, tried with RI 1.2_08 instead of Myfaces, didn't help.

          • 2. Re: a4j:keepAlive issue with facelets

            beanName references to the bean name, but not to the value. I.e. the same as in the faces-config.xml . EL is not allowed there due to the nature of the using saving method.

            P.S. RI 1.2_08 is a most unstable version of JSF implementation.

            • 3. Re: a4j:keepAlive issue with facelets
              cagatay

              From RichFaces user guide;

              <a4j:keepAlive beanName = "#{myClass.testBean}"/>

              Note that the attribute 'beanName' must point to a legal jsf EL expression which resolves to a managed
              mean instance...


              Seems users guide is wrong here:) Anyway I thought keepAlive is same as tomahawk's saveState but it seems I can only keep alive the whole bean, not any property.

              • 4. Re: a4j:keepAlive issue with facelets

                Yes, the doc is not right here. keepAlive is similar to saveState, but allows to save only one particular bean (not bean property).