title: How to display the value selected from <p:selectonemenu> inside <p:confirm> tag?
body: <p>There is one dropdown and one button. After selecting any item and clicking on button I have to display the selected item in the confirmation dialog, how to achieve this. I am using jsf and prime faces. Below is my sample code:</p>
  
  <p>For dropdown:</p>
  
  <pre><code>&lt;p:selectOneMenu
  value="#{decRm.fi_templType}" styleClass="combobox"
  id="temptypID" style="Width:30%" filter="true" onchange="selectedinput()"&gt;
  &lt;f:selectItem itemLabel="--#{lang.select}--" disabled="# 
  {decRm.disableTemplate}"
  itemValue="--Select--" /&gt;
  &lt;f:selectItems value="#{decRm.templtList}"&gt;&lt;/f:selectItems&gt;
  &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>For dialog box:</p>
  
  <pre><code>&lt;p:commandButton  value="#{lang.gen_temp}"&gt; 
  &lt;p:confirm header="Confirmation!" message="#{temptypID}" &gt;&lt;/p:confirm&gt;
  &lt;/p:commandButton&gt;
  
  &lt;p:confirmDialog global="true" showEffect="fade" hideEffect="fade"&gt;
  &lt;p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" onclick="generateTemplate('FI')" /&gt;
  &lt;p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /&gt;
  &lt;/p:confirmDialog&gt;
  </code></pre>
  
  <p>Below is the front end screenshot. Suppose  I selected  T1 from list, I want to display T1 in the confirmation box. </p>
  
  <p><a href="https://i.stack.imgur.com/OHv9w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OHv9w.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/wN27I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wN27I.png" alt="enter image description here"></a></p>