Checkout
Nicolas Malin
committed
on 24 Sep
Fixed: Send upload form with even-update-area doesn't work (Backport from trunk)
(OFBIZ-11207)
When you create a xml form with upload as typ… Show more
Fixed: Send upload form with even-update-area doesn't work (Backport from trunk)

(OFBIZ-11207)

When you create a xml form with upload as type, you can't use on-event-update-area element to submit it by ajax.

Otherwise, OFBiz return an error message on 'uploadFile is empty.

To solve it, we analyze the enctype's form before submit it to move on FormData instead a direct serialize [1]

example form where the problem has been present

****

   <form name='AddNicelyFile' type='upload' target='CreateNicelyFile'>

       <field name='uploadedFile' title='File'><file/></field>

       <field name='addButton'><submit/></field>

       <on-event-update-area event-type='submit' area-id='window' area-target='FileDisplaying'/>

   </form>

****

Thanks to Samuel Tregouet for this fix

[1] https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects Show less