It is possible to call a Service multiple times from a single HTML form (for example, one time for each row in the form) by placing a line similar to the following with a service-multi
event type defined for the controller.xml
request-map entry of the target Service.
Follow these steps to call a Service multiple times:
service-multi
within the controller.xml
request-map entry as shown here:<request-map uri="someService" /> <event type="service-multi" invoke="someService"/> <!-- Other request-map statements intentionally left out --> </request-map>
list-name
is the name of the list that is generating multiple rows for the HTML form:<form name="someFormName" type="multi" use-row-submit="true" list-name="someList" target="someServiceName" / <!-- Form fields removed for reading clarity --> </form>
<form name="mostrecent" mode="POST" action="<@ofbizUrl>someService</@ofbizUrl>"/> <#assign row=0/> <#list someList as listItem> <#-- HTML removed for reading clarity. Each row has a unique input name associated with it allowing this single Form to be submitted to the "someServiceName" Service from each row --> <input type="radio" name="someFormField_o_${row}" value="someValue" checked/> <input type="radio" name="someFormField_o_${row}" value="someValue"/> </#list> </form>
3.149.249.174