--- Anindita Goswami <[EMAIL PROTECTED]> wrote: > In oxf v1.5 we used to use xxforms:error in instance for showing > serverside error. Following is the code we had in the xforms pages: > [...]
Hi Anindita, Let me try to summarize the situation, providing some context. 1) Intend The goal is to have custom code in that would validate the XForms instance as a whole. For example, this code would call a Web service that validates the instance and returns a list of errors. The errors are not for a particular node, but apply to the whole instance. 2) Current code Code was added to the XForms UBL Order do show how to do this, but unfortunately this code does not work anymore with Presentation Server 2.7. I will explain below how to do this with Presentation Server 2.7. 3) How to do this a) The XForms instance has a "dummy" element <global-validation>. This element is always empty. b) The model calls the validation code. If there are errors, it modifies the XForms instance and adds an xxforms:valid="false" on the <global-validation> element and outputs this list of errors in the "data" output. c) For each error (received from the model), the view generates an XForms hidden control bound to the <global-validation> element in the instance, and containing in <xforms:alert> the error message. This control will be picked up by the XForms engine and the error message will ultimately be displayed in the "pink error box" at the top of the page (or the pop-up, if this is what you want a pop-up instead of inline errors). 4) Example code I modified to XForms UBL Order example to make it work as described above. To run this, replace in the 2.7.1 example the files in examples/xforms/xforms-ubl with the model.xpl, view.xsl, and form.xml attached. Also replace the config/xforms-to-xhtml.xsl in the examples with the version attached. Let me know if this works, or if you have any question. Alex
global-errors.this-is-a-zip
Description: global-errors.this-is-a-zip
