title: Pass parameter in jsf, primefaces
body: <p>I have 2 dialogs. In the 1st dialog user writes modulename and I need to pass my modulename to the second dialog and set this modulename value to bean called #{paramController.parameter.modulename}</p>
  
  <p>Please, give me some ideas how to get parameter from one bean and set it to another bean?</p>
  
  <p>
              
                  
                      
                          
                          </p>
  
  <pre><code>                    &lt;/p:inputText&gt;
  
                      &lt;p:outputLabel value="Description" for="moduledescription" /&gt;
                      &lt;p:inputTextarea id="moduledescription" rows="4" cols="53" autoResize="false" value="#{modulesController.selected.moduledescription}"/&gt;
  
                      &lt;p:outputLabel value="Database Name :" for="moduledbname" /&gt;
                       &lt;p:selectOneMenu id="moduledbname" value="#{modulesController.selected.moduledbname}" style="width:342px"&gt;
                                  &lt;f:selectItem itemLabel="Select Connection" itemValue="" noSelectionOption="true" /&gt;
                                  &lt;f:selectItems var="con" value="#{sqlserverController.itemsAvailableSelectOne}" itemValue="#{sqlserverController.getSqlserver(conName)}" /&gt;
                                  &lt;p:ajax update="@this"/&gt;
                       &lt;/p:selectOneMenu&gt;
  
                      &lt;p:outputLabel value="Value :" for="modulevalue" /&gt;
                      &lt;p:inputTextarea id="modulevalue" rows="8" cols="53" autoResize="false" value="#{modulesController.selected.modulevalue}"/&gt;
  
  
  
                  &lt;/p:panelGrid&gt;
                  &lt;p:commandButton  actionListener="#{modulesController.create}" icon="ui-icon-check"  value="Save" update="display,:ModulesListForm:datalist,:growl" oncomplete="handleSubmit(args,'ModulesCreateDialog');"/&gt;
                  &lt;p:commandButton id="btnAdd"  value="Add Parameter" icon="ui-icon-plusthick" onclick="PF('dlg1').show();"&gt;
  
                  &lt;/p:commandButton&gt;
                  &lt;p:commandButton value="Cancel" icon="ui-icon-closethick" onclick="ModulesCreateDialog.hide()"/&gt;
                  &lt;br/&gt;                    
              &lt;/h:panelGroup&gt;
              &lt;br/&gt;
  
  
              &lt;h:form id="ParamForm"&gt;
                  &lt;p:dialog id="AddParamDlg" header="Add Parameter" widgetVar="dlg1" minHeight="40"&gt;                        
                  &lt;h:panelGroup id="displayParam"&gt;
                  &lt;p:panelGrid columns="2"&gt;
                      &lt;p:outputLabel value="Parameter Name :" for="paramname2" /&gt;
                      &lt;p:inputText id="paramname2" value="#{paramController.parameter.paramname}"    style="width:332px" title="#{bundleModules.CreateModulesTitle_modulename}" &gt;
  
                      &lt;/p:inputText&gt;
  
                      &lt;p:outputLabel value="Default Value :" for="defaultvalue2" /&gt;
                      &lt;p:inputText id="defaultvalue2" value="#{paramController.parameter.defaultvalue}" style="width:332px" title="#{bundleModules.CreateModulesTitle_modulename}"/&gt;
  
                      &lt;p:outputLabel value="Module Name :" for="parammodulename2" /&gt;
                      &lt;p:selectOneMenu id="parammodulename2" value="#{paramController.parameter.modulename}" style="width:342px"&gt;
                                  &lt;f:selectItem itemLabel="Select Module Name" itemValue="" noSelectionOption="true" /&gt;
                                  &lt;f:selectItems var="con" value="#{modulesController.itemsAvailableSelectOne}"  itemValue="#{modulesController.getModules(paramname)}" /&gt;
                                  &lt;p:ajax update="@this"/&gt;
                      &lt;/p:selectOneMenu&gt;
                  &lt;/p:panelGrid&gt;
                      &lt;p:commandButton action="#{paramController.addNewParameter}" value="Add" update="displayParam, :ModulesCreateForm:ParamForm" onclick="PF('dlg1').hide()" /&gt;
  
                  &lt;/h:panelGroup&gt;
              &lt;/p:dialog&gt;
              &lt;/h:form&gt;
  
          &lt;/h:form&gt;
  </code></pre>