title: JSF rerender data loaded from DB
body: <p>I have data loaded from DB, when click a command button:</p>
  
  <pre><code>&lt;h:commandButton value="Show article content and comments" action="#{dataBean.activateArticleContentView}" actionListener="#{dataBean.loadCurrentArticle}"&gt;
  &lt;f:attribute name="articleId" value="#{article.id}"&gt;&lt;/f:attribute&gt;
  &lt;/h:commandButton&gt;
  
  @ManagedBean
  @ViewScoped
  public class DataBean implements Serializable {
  
      ...
  
      private List&lt;UserAcc&gt; users;
      private List&lt;Article&gt; articles;
      private List&lt;ArticleComment&gt; articleComments;
  
      private Article currentArticle;
  
      public void loadComments(ActionEvent e) {
          DataBaseUtil dbu = new DataBaseUtil();
          int articleId = (Integer) e.getComponent().getAttributes()
                  .get("articleId");
          articleComments = dbu.loadArticleComments(articleId);
      }
  
      public void loadCurrentArticle(ActionEvent e) {
          DataBaseUtil dbu = new DataBaseUtil();
          int articleId = (Integer) e.getComponent().getAttributes()
                  .get("articleId");
          this.currentArticle = dbu.loadArticleById(articleId);
          this.currentArticle.setComments(dbu.loadArticleComments(articleId));
      }
  ...
  </code></pre>
  
  <p>it loads the article and it's comments. Also textArea and a commandButton are rendered, on the same page, for adding a comment.</p>
  
  <pre><code>&lt;h:inputTextarea value="#{persistenceBean.text}" style="height: 50px; width: 300px"&gt;
  &lt;/h:inputTextarea&gt;
  &lt;h:commandButton value="Save" actionListener="#{persistenceBean.saveComment}"&gt;
      &lt;f:attribute name="userName" value="#{loginBean.name}"&gt;&lt;/f:attribute&gt;
      &lt;f:attribute name="articleId" value="#{dataBean.currentArticle.id}"&gt;&lt;/f:attribute&gt;
  &lt;/h:commandButton&gt;
  </code></pre>
  
  <p>The command button activates this method in another bean (PersistenceBean):</p>
  
  <pre><code>public void saveComment(ActionEvent e){
          int articleId = (Integer) e.getComponent().getAttributes().get("articleId");
          String userName = (String) e.getComponent().getAttributes().get("userName");
  
          DataBaseUtil dbu = new DataBaseUtil();
  
          UserAcc user = dbu.loadUserByName(userName);
          ArticleComment comment = new ArticleComment();
          comment.setText(this.text);
          Date postat = new Date();
          comment.setPostat(postat.toString());
  
          dbu.saveComment(articleId, user.getId(), comment);
      }
  </code></pre>
  
  <p>My question is how to rerender the table with the comments, so that the change can be shown immediately. Now i need to back to the articles view and click the button that shows the article content and comments. Can i have more than one action listener for the button that adds the comment, int other words, how to use <code>dataBean.loadCurrentArticle</code>  once again after add the comment.</p>