title: p:menuitems with f:param for pass parameters
body: <p>I have menu bar <code>&lt;p:submenu&gt;</code> which have phone brands as its menu items these menu items should redirect to same page but loading data should different. So I tried to use param and viewparam to catch the brand name</p>
  
  <p>Menu bar JSF code</p>
  
  <pre><code>&lt;p:submenu label="PHONES"&gt;
      &lt;p:menuitem value="Apple" outcome="phones" &gt;                               
          &lt;f:param name="brand" value="Apple" /&gt;
      &lt;/p:menuitem&gt;
      &lt;p:menuitem value="Motorola" outcome="phones" &gt;
          &lt;f:param name="brand" value="Motorola"/&gt;
      &lt;/p:menuitem&gt;
      &lt;p:menuitem value="Nokia" outcome="phones"&gt;
          &lt;f:param name="brand" value="Nokia"/&gt;
      &lt;/p:menuitem&gt;
      &lt;p:menuitem value="Samsung" outcome="phones"&gt;
          &lt;f:param name="brand" value="Samsung"/&gt;
      &lt;/p:menuitem&gt;
  &lt;/p:submenu&gt; 
  </code></pre>
  
  <p>paramview code - this code is in different xhtml file. coded beginning of body</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h:body&gt;
      &lt;f:metadata&gt;  
          &lt;f:viewParam name="brand" value="#{phonesBean.brand}" /&gt;  
      &lt;/f:metadata&gt;
  </code></pre>
  
  <p>PhonesBean</p>
  
  <pre class="lang-java prettyprint-override"><code>@ManagedBean
  @RequestScoped
  public class PhonesBean implements Serializable {
  
      private String brand;
      private List&lt;PhoneSummary&gt;phoneList = new ArrayList&lt;PhoneSummary&gt;();
  
      /**
       * Creates a new instance of PhonesBean
       */
      public PhonesBean() {
          getPhoneModelList();
      }
  
      private void getPhoneModelList(){
          brand=MenuItemManage.phoneBrand;
          DbPhones dbPhones = new DbPhones();
          phoneList=dbPhones.getPhonesSummary(brand);    
      }
  }
  </code></pre>
  
  <p>Now when <code>&lt;p:menuitem&gt;</code> is clicked it redirects to page with parameter tagging like "brand=Nokia" but I can't catch it from <code>&lt;f:viewParam&gt;</code> and set it to a bean variable. How to fix this?</p>