Handeling Service Response and showing error messages

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Handeling Service Response and showing error messages

Chaminda Amarasinghe

Hi All,

I am a newbie to this group and Orbeon itself,

I am calling a restful service from orbeon, and response is as follows,

<response>
<status>ERROR</status>
<errors>
<error field="firstName">First Name should not be empty</error>
<error field="lastName">Last Name should not be empty</error>
</errors>
</response>

With this response, I need to displace the error message (text of the error element) for relevant field,  or at least all errors as global error massages,

Other than above response, I cant fire any event from server-side such as xforms-submit-error or change the format of the response.

Can someone help me to sortout this ?

Many thanks,
Chaminda

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Chaminda Amarasinghe
Hi

One clarification, I have no any issue with calling service,

Problem I am facing is handeling the response and displaying error messages, also note form component name and error filed attribute value are same.

Regards,

On Wednesday, April 17, 2013 12:49:56 AM UTC+5:30, Chaminda Amarasinghe wrote:

Hi All,

I am a newbie to this group and Orbeon itself,

I am calling a restful service from orbeon, and response is as follows,

<response>
<status>ERROR</status>
<errors>
<error field="firstName">First Name should not be empty</error>
<error field="lastName">Last Name should not be empty</error>
</errors>
</response>

With this response, I need to displace the error message (text of the error element) for relevant field,  or at least all errors as global error massages,

Other than above response, I cant fire any event from server-side such as xforms-submit-error or change the format of the response.

Can someone help me to sortout this ?

Many thanks,
Chaminda

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Jeremy Nix
See this thread.  May or may not be related to what you are coming across:

http://discuss.orbeon.com/Handling-submission-errors-td4656287.html

_____________________________________________
Jeremy Nix
Senior Application Developer
Biomedical Informatics
Cincinnati Children's Hospital Medical Center
513-803-2764 / [hidden email]
On 04/16/2013 03:34 PM, Chaminda Amarasinghe wrote:
Hi

One clarification, I have no any issue with calling service,

Problem I am facing is handeling the response and displaying error messages, also note form component name and error filed attribute value are same.

Regards,

On Wednesday, April 17, 2013 12:49:56 AM UTC+5:30, Chaminda Amarasinghe wrote:

Hi All,

I am a newbie to this group and Orbeon itself,

I am calling a restful service from orbeon, and response is as follows,

<response>
<status>ERROR</status>
<errors>
<error field="firstName">First Name should not be empty</error>
<error field="lastName">Last Name should not be empty</error>
</errors>
</response>

With this response, I need to displace the error message (text of the error element) for relevant field,  or at least all errors as global error massages,

Other than above response, I cant fire any event from server-side such as xforms-submit-error or change the format of the response.

Can someone help me to sortout this ?

Many thanks,
Chaminda
--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Alessandro  Vernet
Administrator
In reply to this post by Chaminda Amarasinghe
Hi Chaminda,

Also, is this with a form you wrote "by hand" in XForms, or for a form you created with Form Builder?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Chaminda Amarasinghe
In reply to this post by Jeremy Nix
Hi Nix,

Thanks for the reply,

I went through this thread early. As I said, I cant send "xforms-submit-error"

Regards

On Wednesday, April 17, 2013 5:18:41 AM UTC+5:30, Nix, Jeremy wrote:
See this thread.  May or may not be related to what you are coming across:

http://discuss.orbeon.com/Handling-submission-errors-td4656287.html

_____________________________________________
Jeremy Nix
Senior Application Developer
Biomedical Informatics
Cincinnati Children's Hospital Medical Center
513-803-2764 / <a href="javascript:" target="_blank" gdf-obfuscated-mailto="VPPSBTPVV78J">Jerem...@...
On 04/16/2013 03:34 PM, Chaminda Amarasinghe wrote:
Hi

One clarification, I have no any issue with calling service,

Problem I am facing is handeling the response and displaying error messages, also note form component name and error filed attribute value are same.

Regards,

On Wednesday, April 17, 2013 12:49:56 AM UTC+5:30, Chaminda Amarasinghe wrote:

Hi All,

I am a newbie to this group and Orbeon itself,

I am calling a restful service from orbeon, and response is as follows,

<response>
<status>ERROR</status>
<errors>
<error field="firstName">First Name should not be empty</error>
<error field="lastName">Last Name should not be empty</error>
</errors>
</response>

With this response, I need to displace the error message (text of the error element) for relevant field,  or at least all errors as global error massages,

Other than above response, I cant fire any event from server-side such as xforms-submit-error or change the format of the response.

Can someone help me to sortout this ?

Many thanks,
Chaminda
--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="VPPSBTPVV78J"> orbeon+u...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="VPPSBTPVV78J"> or...@....
 
 

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Chaminda Amarasinghe
In reply to this post by Alessandro Vernet


Hi Alex,

In this example we created the form using Form Builder,

We have more control on forms side, If there is any difference, I can write by hand,

Regards,
Chaminda


On Wednesday, April 17, 2013 5:45:00 AM UTC+5:30, Alessandro Vernet wrote:
Hi Chaminda,

Also, is this with a form you wrote "by hand" in XForms, or for a form you
created with Form Builder?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Handeling-Service-Response-and-showing-error-messages-tp4656558p4656566.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Chaminda Amarasinghe

Hi All,

I am trying to iterate through the errors/error and add error-summary after response as follows

<fr:error-summary observer="my-group">
    <fr:errors nodeset="instance('response')errors/error">
        <fr:label ref="@field"/>
        <fr:alert ref="text"/>
    </fr:errors>
</fr:error-summary>

Can someone please comment about my approach?

Thanks

On Wednesday, April 17, 2013 10:07:24 AM UTC+5:30, Chaminda Amarasinghe wrote:


Hi Alex,

In this example we created the form using Form Builder,

We have more control on forms side, If there is any difference, I can write by hand,

Regards,
Chaminda


On Wednesday, April 17, 2013 5:45:00 AM UTC+5:30, Alessandro Vernet wrote:
Hi Chaminda,

Also, is this with a form you wrote "by hand" in XForms, or for a form you
created with Form Builder?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Handeling-Service-Response-and-showing-error-messages-tp4656558p4656566.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Chaminda Amarasinghe


Hi All,

I am still struggling with this,

Any help, direction highly appreciated,

Regards,

On Thursday, April 18, 2013 1:01:59 AM UTC+5:30, Chaminda Amarasinghe wrote:

Hi All,

I am trying to iterate through the errors/error and add error-summary after response as follows

<fr:error-summary observer="my-group">
    <fr:errors nodeset="instance('response')errors/error">
        <fr:label ref="@field"/>
        <fr:alert ref="text"/>
    </fr:errors>
</fr:error-summary>

Can someone please comment about my approach?

Thanks

On Wednesday, April 17, 2013 10:07:24 AM UTC+5:30, Chaminda Amarasinghe wrote:


Hi Alex,

In this example we created the form using Form Builder,

We have more control on forms side, If there is any difference, I can write by hand,

Regards,
Chaminda


On Wednesday, April 17, 2013 5:45:00 AM UTC+5:30, Alessandro Vernet wrote:
Hi Chaminda,

Also, is this with a form you wrote "by hand" in XForms, or for a form you
created with Form Builder?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Handeling-Service-Response-and-showing-error-messages-tp4656558p4656566.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Handeling Service Response and showing error messages

Alessandro  Vernet
Administrator
In reply to this post by Chaminda Amarasinghe
Hi Chaminda,

Calling a "validation service" is a use case that Form Builder doesn't support very well at this point. What you can do with what is returned by a service is limited by what the Form Builder "actions" lets you do, and at this point it is just setting the value of controls. As a workaround, you could:

1. In the action calling the service, store in a hidden field you name "fields-with-error", the ids of the fields returned by the service. With your example, the XPath would be: string-join(/response/errors/error/@field, ' '). So the field would for instance contain "firstName lastName".

2. Set the constraint expression for the firstName field to: tokenize($fields-with-error, ' ') = 'firstName', and similar for lastName.

This still won't show the error message returned in the service, which right now with Form Builder needs to be in the form definition.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet