xforms-submit (event)Added by IBM on October 10, 2012 | Version 1 (Original)
|Occurs when an XForms submission begins.
Available In <xforms:submission> element
Example The following example illustrates how you can remove empty rows from a table before submitting a form.
First, you must set up your <xforms:submission> as shown below. When this submission begins, an xforms-submit event occurs. This triggers the first xforms:setvalue action, which sets an element in the data model to "true" to indicate that a submission is in progress. If the submission returns an error, an xforms-submit-error event occurs. This triggers the second xforms:setvalue action, which sets the same element in the data model to "false" to indicate that a submission is no longer occurring.
Next, you must create an <xforms:bind> that affects the relevancy of the rows in the form, as shown:
<xforms:submission id="S" method="post" includenamespaceprefixes=""
This bind applies the following logic to each row in the table (except for the last row, which is assumed to be a template row): if the quantity is greater than zero or the form is not submitting, then the row is relevant; otherwise, the row is not relevant. This effectively makes all empty rows non-relevant when the form is being submitted (keeping in mind that template rows are already marked as non-relevant).
<xforms:bind nodeset="order/row [not(last())]"
relevant="boolean-from-string( if( qty > 0 or
instance('temps')/submitting='false', 'true', 'false'))"/>