0

I´m using Spring Web Flow but when I click submit button, it does not do anything; no errors, no exception, just redirect to the same page. Here is my code:

ConsultarControlOrdenAcunacionFlow.xml:

<view-state id="ConsultarControlOrdenAcunacion" model="ordenesAcunacionParaAutorizar">
    <binder>
        <binding property="ordenIds" required="true"></binding>            
        <binding property="comentario" required="true"></binding>            
    </binder>        
    <transition on="firmarOrdenes" to="GetDatosParaFirma" validate="false"/>
</view-state>

ConsultarControlOrdenAcunacion.jsp:

    <form:form id="formaAplicaAccion" modelAttribute="ordenesAcunacionParaAutorizar" action="${flowExecutionUrl}" method="POST" >
        <form:input path="ordenIds" id="ordenIds" type="hidden" name="ordenIds" value=""/>
        <form:input path="comentario" id="comentario" type="hidden" name="comentario" value="xxxxxxxxxxxxxxx"/>
        <table cellpadding="0" cellspacing="0" border="1" class="display" id="ordenes1" style="font-size: 12px;" >
        </table>
        <input style="display:none;" id="botonAutorizar" type="submit" name="_eventId_firmarOrdenes" value="Firmar Datos"/>
    </form:form>

Jquery code:

$("#formaAplicaAccion").submit();

What am I doing wrong?

Thanks

2 Answers2

2

I've had the same issue. I fixed it by adding a hidden element that has a name equal to the button name. This works for me.

Digant
  • 21
  • 2
0

I'd start with using a plugin like Firebug to view the submitted request. I'm betting that the JQuery form.submit() doesn't submit the button name _eventId_firmarOrdenes that tells Web Flow which transition to take.

A couple of additional tips: First, the action= is unnecessary in the form:form tag. I can't find an authoritative source right now, but WebFlow will provide the correct action value automatically if you omit action= altogether.

Second, name is not a valid attribute for form:input. Also, normally you want to use form:hidden instead of form:input (see that same link for valid attributes).

dbreaux
  • 4,982
  • 1
  • 25
  • 64