I want toupdate a value everytime a change in value occurs in a selectOneMenu, and that works well, but I have a submit button that should be pressed after making a selection, the thing is that when I press that button with a selection made the entire class (bean) resets, I do not want the class to reset
<div class="top-panel">
<div class="labels">
<label class="maquina">Maquina: #{buscarBean.maqSeleccionada}</label>
<label class="label">Estado de la busqueda: </label>
</div>
<div class="dropdown">
<p:selectOneMenu class="dropdown-select" id="seleccion"
value="#{buscarBean.maqSeleccionada}">
<f:selectItem itemLabel="Selecciona Maquina" itemValue="" />
<f:selectItems value="#{buscarBean.getMapMaquinas()}" />
<p:ajax event ="valueChange"
partialSubmit="true"
listener="#{buscarBean.maqSeleccionada}" />
</p:selectOneMenu>
</div>
<h:form>
<div class="buttons">
<button class="button">Parar Busqueda</button>
<button class="button">Ver Respuesta de la Maquina</button>
<button class="button">Parametros Seleccionados</button>
<h:commandButton class="button" value="Mostrar Todos los Parametros" action="#{buscarBean.updateCrearArchivo()}" />
</div>
</h:form>
</div>
I have tried changing the scope of the bean and different methods of writing the ajax.