0 Replies Latest reply on Jul 18, 2007 9:36 AM by Kamil Gorlo

    a4j:keepAlive beanName

    Kamil Gorlo Newbie

      Hi,

      I have my own facelets tag, where I pass some parameters - one of these parameters is managed bean (request scope).

      <a:mytag bean="#{someBean}" />
      


      Inside this tag whis is based on ajax requests i'm calling methods from this bean and I want to use a4j:keepAlive to keep this bean alive :) So I want to write something like this:

      <a4j:keepAlive beanName="#{bean}"/>
      


      But this gives me an error that beanName "Must be literal". So i have to pass beanName explicite as string in some way...
      This does not work:

      <a4j:keepAlive beanName="bean"/>
      


      Of course it works if "bean" is real nama of managed bean, not facelets tag parameter.

      How to deal with this problem?

      Also in this article:

      http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/2

      Author says that:



      <a4j:keepAlive beanName = "#{manager.empBean}">
      </a4j:keepAlive>


      Note that the attribute must point to a legal Jsf EL Expression which resolves to a Managed Bean instance.


      Which in my opinion is false... [from my experience it will end with "Must be literal" error]. I must use name of bean - not instance of bean.