4 Replies Latest reply on Dec 22, 2008 9:00 PM by Matt Rauls

    reRender problem

    Martin Sznapka Newbie

      I have problem with this simple Ajax example:

      <h:outputText value="outputText" rendered="#{outside1.rendered}"/>
      <a4j:commandLink action="#{ajax.increaseCounter}" ajaxSingle="true" reRender="ajaxOutputPanel" value="link"/>
      <a4j:outputPanel id="ajaxOutputPanel">
      <a4j:repeat value="#{outside2.list}" var="item">

      Now, if I click on the ajax link, than the counter is increased and outputPanel shows the new value, BUT the ajax request also calls outside1.rendered and outside2.list! And that is the problem for me, because these outside beans (request scoped) loads data from database, which I dont want during this ajax request.
      The only bean which should be created is Ajax class.
      Does anyone have an idea how to achieve that?

      Working example in Tomcat.

      The rest of the code is here:

      public class Ajax {
       private int counter;
       public void create() {
       counter = 0;
       public void increaseCounter() {
       public int getCounter() {
       return counter;

      public class Outside1 {
       private boolean rendered;
       public void create() {
       rendered = true;
       public boolean isRendered() {
       return rendered;

      public class Outside2 {
       private List<Integer> list;
       public void create() {
       list = Arrays.asList(1,2,3);
       public List<Integer> getList() {
       return list;

      Possible solution with moving outside beans to higher scope than Event is not acceptable for me.