I have a selectonemenu that appears in 2 different dialogs on the same screen, I need that when one of them changes its value and then user opens the other dialog, the selectonemenu still has the selected value previously, and viceversa.
I tried doing same binding for both of them but I notice that one of them would dissapear, whats the proper way to achieve this?
this is the code of them by the way:
<p:selectOneMenu binding="#{homeView.somTipoPlato}"
id="somTipoPlato" style="width:100%">
<p:ajax event="change" listener="#{homeView.listerprueba}" />
<f:selectItem itemLabel="Tipo de Comida"></f:selectItem>
<f:selectItems value="#{homeView.losTipoPlatoSelectItem}" />
</p:selectOneMenu>
<p:selectOneMenu id="somTipoPlatoBuscarPlato"
binding="#{homeView.somTipoPlato}" style="width:100%">
<p:ajax event="change" listener="#{homeView.listerprueba}" />
<f:selectItem itemLabel="Tipo de Comida"></f:selectItem>
<f:selectItems value="#{homeView.losTipoPlatoSelectItem}" />
</p:selectOneMenu>
Any proper way or workaround?