object data empty in long running conversation
i92jurir Aug 14, 2012 8:30 AMHi all,
I´m new in the forum. I´m learning Seam 2 for my own. I´m trying to build a very simple application to learn about conversations. I´m doing a simple 2 step wizard to store an entity in the database. In the first step the user can enter data. In step two data inserted in step one is show and user can cancel or confirm the store operation. When user enter in step 1 a long-running conversation is started.
Step 1 xhtml
<h:form id="reservarPaso1Form"> <rich:panel> <f:facet name="header">Paso 1</f:facet> <s:decorate id="fechaEntradaField" template="layout/edit.xhtml"> <ui:define name="label">Fecha entrada</ui:define> <rich:calendar id="fechaEntrada" required="true" value="#{nuevaReserva.fechaEntrada}" datePattern="MM/dd/yyyy" /> </s:decorate> <s:decorate id="fechaSalidaField" template="layout/edit.xhtml"> <ui:define name="label">Fecha salida</ui:define> <rich:calendar id="fechaSalida" value="#{nuevaReserva.fechaSalida}" datePattern="MM/dd/yyyy" /> </s:decorate> </rich:panel> <div class="actionButtons"> <s:button id="cancelar" value="Cancelar" view="/home.xhtml" propagation="end"/> <s:button id="siguiente" value="Siguiente" view="/reservarPaso2.xhtml"/> </div> </h:form>
Users should hit in 'Siguiente' button to go to step2 page.
s:button tag should store nuevaReserva object in conversation context and propagate it.
Step 2 xhtml
<h:form id="reservarPaso2Form"> <rich:panel> <f:facet name="header">Paso 2</f:facet> <s:decorate id="fechaEntradaField" template="layout/edit.xhtml"> <ui:define name="label">Fecha entrada</ui:define> <rich:calendar id="fechaEntrada" required="true" value="#{nuevaReserva.fechaEntrada}" datePattern="MM/dd/yyyy" /> </s:decorate> <s:decorate id="fechaSalidaField" template="layout/edit.xhtml"> <ui:define name="label">Fecha salida</ui:define> <rich:calendar id="fechaSalida" value="#{nuevaReserva.fechaSalida}" datePattern="MM/dd/yyyy" /> </s:decorate> </rich:panel> <div class="actionButtons"> <s:button id="confirmar" value="Confirmar" view="/home.xhtml" action="#{realizarReserva.confirmar}"/> <s:button id="cancelar" value="Cancelar" view="/home.xhtml" propagation="end"/> </div> </h:form>
The problem is page 2 fields are blank when plage is shown. In Jboss Seam Debug Page I can see nuevaReserva object but attributes are empty. What am I doing wrong?
nuevaReserva entity
@Entity @Name("nuevaReserva") public class Reserva implements Serializable { private Long id; private Date fechaEntrada; private Date fechaSalida; ....... }
Thanks is advance.