title: JSF - Redirect to page and remember parameter ID for searching
body: <p>I have two xhtml pages and two managed beans. </p>
  
  <p>On first page I have a list of topics (records from database table - second column contains <code>&lt;h:commandLink&gt;</code> tags):</p>
  
  <p><img src="https://i.stack.imgur.com/FWUfo.png" alt="enter image description here"></p>
  
  <p><strong>Part of reduced code:</strong></p>
  
  <pre><code>&lt;rich:column&gt;&lt;h:outputText value="#{item.id}"/&gt;&lt;/rich:column&gt;
  &lt;rich:column&gt;&lt;h:outputText value="#{item.createdBy}"/&gt;&lt;/rich:column&gt;
  &lt;rich:column&gt;
    &lt;h:commandLink value="#{item.topic}" action="#{myTools.setMenuItem('posts')}"/&gt;
  &lt;/rich:column&gt;
  </code></pre>
  
  <p>I'm using <code>action="#{myTools.setMenuItem('posts')}"</code> to redirect to page posts.xhtml. 
  How can I pass the parameter <code>"#{item.id}"</code> to be able to find all posts to topic with given ID? </p>
  
  <p><strong>UPDATE (using DataModel):</strong>
  This could be the way:</p>
  
  <pre><code>&lt;h:commandLink value="#{item.topic}" action="#{myTopic.submit}"&gt;
  
  public String submit()
  {
    topic = model.getRowData();
    return "/posts.xhtml?faces-redirect=true&amp;id=" + topic.getId();
  }
  </code></pre>
  
  <p>But I still don´t know how to pass the <code>topic.getId()</code> parameter to another bean (MyPosts)..?</p>