Good afternoon, I wanted to know if please someone could help me with the following, as I search and I can not find a solution.
I have a form called "formuPrestamo", which collects values from a Session-managed managedBean called "frances" in an inputText (which initially has all 0) performs some operations and redirects to another page.
The problem is that when I re-open the form "formuPrestamo" the managedBean values remain in the inputText and I need those values to be 0 again.
Thank you very much.
Greetings.
view
</h:panelGrid>
</p:fieldset>
<p:fieldset legend="Datos de Préstamo" toggleable="true" toggleSpeed="500">
<p:ajax event="toggle" listener="#{vistaFieldSet.handleToggle(event)}" update="msgs"/>
<h:panelGrid columns="2" cellpadding="5">
<p:outputLabel value="Monto Prestado:" for="montoprestado" />
<p:inputText id="montoprestado" value="#{frances.montoSolicitado}" title="Montoprestado"
readonly="true" />
<p:outputLabel value="Fecha de Solicitud:" for="fechaSolicitud" />
<p:inputText id="fechaSolicitud" value="#{frances.fechaSolicitud}" title="FechaSolicitud"
readonly="true"
>
<f:convertDateTime pattern="MM/dd/yyyy" />
</p:inputText>
<p:outputLabel value="Cuotas:" for="cantidadCuotas" />
<p:inputText id="cantidadCuotas" value="#{frances.plazo}" title="CantidadCuotas"
readonly="true"
/>
<p:outputLabel value="TNA %:" for="tna" />
<p:inputText id="tna" value="#{frances.tasa}" title="Tna"
readonly="true"/>
<p:outputLabel value="Gastos Adm:" for="gastosAdm" />
<p:inputText id="gastosAdm" value="#{frances.go}" title="GastosAdm"
readonly="true"/>
<p:outputLabel value="Seg. de Vida:" for="seguroVida" />
<p:inputText id="seguroVida" value="#{frances.sv}" title="SeguroVida"/>
<p:outputLabel value="IVA %:" for="iva" />
<p:inputText id="iva" value="#{frances.iv}" title="IVA"
readonly="true"/>
<p:outputLabel value="Observación:" for="observacion" />
<p:inputTextarea id="observacion" value="#{prestamoController.prestamo.observacion}" title="Observacion" />
<p:outputLabel for="somDoc" value="Estado "/>
<p:selectOneMenu id="somDoc" value="#{prestamoController.estadoPrestamo.idestadoprestamo}"
converter="javax.faces.Integer"
required="true"
requiredMessage="Debe seleccionar el estado del préstamo">
<f:selectItem itemLabel="Seleccionar" itemValue=""/>
<!--<f:selectItem itemLabel="Activo" itemValue="1"/>
<f:selectItem itemLabel="Cancelado" itemValue="2"/>-->
<f:selectItem itemLabel="Pendiente de Pago" itemValue="3"/>
</p:selectOneMenu>
</h:panelGrid>
</p:fieldset>
<p:commandButton id="btnBoton"
icon="ui-icon-check" value="#{app['boton.grant']}"
action="#{prestamoController.otorgarPrestamo()}"
update="msgs"
ajax="false"/>
<p:commandButton id="btnBotn"
icon="ui-icon-print" value="#{app['boton.print']}"
action="#{prestamoController.exportarPDF()}"
ajax="false"/>
</h:form>
Method to grant a loan
FacesContext context = FacesContext.getCurrentInstance();
context.getExternalContext().getFlash().setKeepMessages(true);
JSFUtil.addSuccessMessage(rf.getMensajeArb("info.save"));
//remover:
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("Frances");
return "/faces/pages/prestamo/simulaPrestamo.xhtml?facesredirect=true";