Hi Alex,
Thanks for your response.
I have already solved this problem. If there is any error message in instance, I created hidden elements capturing them. Then I accessed those hidden elements from _javascript_ and showed them in pop up. Following is the code in my xforms page:

<xforms:repeat nodeset="errors/error">
        <xxforms:hidden ref="@xxforms:error" xhtml:id="Error"/>
</xforms:repeat>

I did this in v2.6. Will it work in v2.7 as well?

Thanks
Anindita
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
----------------------------------------------------------------------------------------



Alessandro Vernet <avernet
@orbeon.com>

Sent by: orbeon-user-admin

01/26/2005 07:54 AM
Please respond to orbeon-user

       
        To:        [email protected]
        cc:        
        Subject:        Re: [orbeon-user] Server side error not showing



--- 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

<< Attachment Removed : global-errors.this-is-a-zip >>

Reply via email to