Re: Issue with ajax and json response

2011-08-29 Thread Atul Vani

Jacques,

Got it, will do it soon, Thanks :)

Thanks&  Regards
Atul Vani
Enterprise Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/
We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.


On Monday 29 August 2011 01:05 PM, Jacques Le Roux wrote:

Atul,

These interesting comments should be better in the Jira

Thanks

Jacques

From: "Atul Vani" 

Ok, hadn't checked the code yet, did it now, my bad :)

What I oberved is that when I enter promo code, it fires an ajax 
request and don't display me the error message when I entered the 
wrong code, need to fix that. Well, the interesting part is, it then 
fires another ajax request to check if the cart is empty, how 
possibly can a cart get empty by applying a promo code :-/ And then 
it fires another one to update the cart with the discounted price. 
Why don't we return the updated cart along with the error message, if 
any, and replace the existing html with the new one, so that user is 
displayed with the error message and the updated cart both, will also 
save us two extra ajax requests. Another thing I noticed is that 
lot's of elements are being identified using their ids, not so good.


- Original Message -
From: "Atul Vani" 
To: user@ofbiz.apache.org
Sent: Sunday, August 28, 2011 10:47:07 PM
Subject: Re: Issue with ajax and json response

Jonatan,

IMO, the event you invoked in your request mapping should be fixed to 
return error response, when they get errors. It will cause the error 
response to be rendered instead of the success. Then you can use 
type="request" value="json" for the error response. The responseText 
recieved by the ajax will be a JSON String. You can then pass this 
JSON string to the getServerError() function to extract and return 
error message(s). I don't know if this information will be useful to 
you or not, as I haven't seen the code, but this is pretty much all 
one needs to check :)



- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Saturday, August 27, 2011 3:51:58 PM
Subject: Re: Issue with ajax and json response

Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no 
matters what

kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, 
where can I

find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani 
wrote:



Jonatan,

I think if you use

(it is used in several places in ecommerce and other components'
controller.xml)

and then use the getServerError() function
(used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
to parse the JSON response,
then you should be able to retrieve the error message to display it 
to the

user.

I'm not sure if it will be helpful, I didn't got the problem completely
either ;-)


- Original Message -----
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Sunday, July 17, 2011 5:56:10 PM
Subject: Re: Issue with ajax and json response

Done. Patch provided, not fully tested.
https://issues.apache.org/jira/browse/OFBIZ-4342

<https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,


On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray wrote:

> Yeah, checking for the _ERROR_MESSAGE* keys is the right way to 
go, would

> be great if you could create a jira issue so this doesn't get lost.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
>
> > Well, I did a little read on the jquery ajax documentation (
> > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> wrong.
> > It is definitively not related to
> > the CommonEvents#jsonResponseFromRequestAttributes. I felt 
stupid when

I
> > realized that the result the controller returns has nothing to 
do with

> the
> > ajax callbacks :)
> >
> > According to this doc the error callback is:
> > "A function to be called if the request fails"
> >
> > In the case I'm exposing, obviously the request is not failing 
so the

> error
> > I'm getting should be handled in the success callback. Please, 
tell me

if
> > there is another way to do it.
> > I found a js function in the CheckoutProcess.js called
> getServerError(...)
> > which is never invoked. I think it should be included in the 
success

> > callback like the following code:
> >
> > (chekoutProcess.js)
> >
> > // Check server side error
> > function getServerError(data) {
> >

Re: Issue with ajax and json response

2011-08-29 Thread Jacques Le Roux

Atul,

These interesting comments should be better in the Jira

Thanks

Jacques

From: "Atul Vani" 

Ok, hadn't checked the code yet, did it now, my bad :)

What I oberved is that when I enter promo code, it fires an ajax request and don't display me the error message when I entered the 
wrong code, need to fix that. Well, the interesting part is, it then fires another ajax request to check if the cart is empty, how 
possibly can a cart get empty by applying a promo code :-/ And then it fires another one to update the cart with the discounted 
price. Why don't we return the updated cart along with the error message, if any, and replace the existing html with the new one, 
so that user is displayed with the error message and the updated cart both, will also save us two extra ajax requests. Another 
thing I noticed is that lot's of elements are being identified using their ids, not so good.


- Original Message -
From: "Atul Vani" 
To: user@ofbiz.apache.org
Sent: Sunday, August 28, 2011 10:47:07 PM
Subject: Re: Issue with ajax and json response

Jonatan,

IMO, the event you invoked in your request mapping should be fixed to return error response, when they get errors. It will cause 
the error response to be rendered instead of the success. Then you can use type="request" value="json" for the error response. The 
responseText recieved by the ajax will be a JSON String. You can then pass this JSON string to the getServerError() function to 
extract and return error message(s). I don't know if this information will be useful to you or not, as I haven't seen the code, 
but this is pretty much all one needs to check :)



- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Saturday, August 27, 2011 3:51:58 PM
Subject: Re: Issue with ajax and json response

Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no matters what
kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, where can I
find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani wrote:


Jonatan,

I think if you use

(it is used in several places in ecommerce and other components'
controller.xml)

and then use the getServerError() function
(used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
to parse the JSON response,
then you should be able to retrieve the error message to display it to the
user.

I'm not sure if it will be helpful, I didn't got the problem completely
either ;-)


- Original Message -----
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Sunday, July 17, 2011 5:56:10 PM
Subject: Re: Issue with ajax and json response

Done. Patch provided, not fully tested.
https://issues.apache.org/jira/browse/OFBIZ-4342

<https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,


On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray wrote:

> Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
> be great if you could create a jira issue so this doesn't get lost.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
>
> > Well, I did a little read on the jquery ajax documentation (
> > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> wrong.
> > It is definitively not related to
> > the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when
I
> > realized that the result the controller returns has nothing to do with
> the
> > ajax callbacks :)
> >
> > According to this doc the error callback is:
> > "A function to be called if the request fails"
> >
> > In the case I'm exposing, obviously the request is not failing so the
> error
> > I'm getting should be handled in the success callback. Please, tell me
if
> > there is another way to do it.
> > I found a js function in the CheckoutProcess.js called
> getServerError(...)
> > which is never invoked. I think it should be included in the success
> > callback like the following code:
> >
> > (chekoutProcess.js)
> >
> > // Check server side error
> > function getServerError(data) {
> >var serverErrorHash = [];
> >var serverError = "";
> >if (data._ERROR_MESSAGE_LIST_ != undefined) {
> >serverErrorHash = data._ERROR_MESSAGE_LIST_;
> >jQuery.each(serverErrorHash, function(i, error) {
> >serverError += error.message + '';
> >});
> &

Re: Issue with ajax and json response

2011-08-28 Thread Atul Vani
Ok, hadn't checked the code yet, did it now, my bad :)

What I oberved is that when I enter promo code, it fires an ajax request and 
don't display me the error message when I entered the wrong code, need to fix 
that. Well, the interesting part is, it then fires another ajax request to 
check if the cart is empty, how possibly can a cart get empty by applying a 
promo code :-/ And then it fires another one to update the cart with the 
discounted price. Why don't we return the updated cart along with the error 
message, if any, and replace the existing html with the new one, so that user 
is displayed with the error message and the updated cart both, will also save 
us two extra ajax requests. Another thing I noticed is that lot's of elements 
are being identified using their ids, not so good.

- Original Message -
From: "Atul Vani" 
To: user@ofbiz.apache.org
Sent: Sunday, August 28, 2011 10:47:07 PM
Subject: Re: Issue with ajax and json response

Jonatan,

IMO, the event you invoked in your request mapping should be fixed to return 
error response, when they get errors. It will cause the error response to be 
rendered instead of the success. Then you can use type="request" value="json" 
for the error response. The responseText recieved by the ajax will be a JSON 
String. You can then pass this JSON string to the getServerError() function to 
extract and return error message(s). I don't know if this information will be 
useful to you or not, as I haven't seen the code, but this is pretty much all 
one needs to check :)


- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Saturday, August 27, 2011 3:51:58 PM
Subject: Re: Issue with ajax and json response

Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no matters what
kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, where can I
find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani wrote:

> Jonatan,
>
> I think if you use
> 
> (it is used in several places in ecommerce and other components'
> controller.xml)
>
> and then use the getServerError() function
> (used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
> to parse the JSON response,
> then you should be able to retrieve the error message to display it to the
> user.
>
> I'm not sure if it will be helpful, I didn't got the problem completely
> either ;-)
>
>
> ----- Original Message -
> From: "Jonatan Soto" 
> To: user@ofbiz.apache.org
> Sent: Sunday, July 17, 2011 5:56:10 PM
> Subject: Re: Issue with ajax and json response
>
> Done. Patch provided, not fully tested.
> https://issues.apache.org/jira/browse/OFBIZ-4342
>
> <https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,
>
>
> On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray  >wrote:
>
> > Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
> > be great if you could create a jira issue so this doesn't get lost.
> >
> > Regards
> > Scott
> >
> > HotWax Media
> > http://www.hotwaxmedia.com
> >
> > On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
> >
> > > Well, I did a little read on the jquery ajax documentation (
> > > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> > wrong.
> > > It is definitively not related to
> > > the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when
> I
> > > realized that the result the controller returns has nothing to do with
> > the
> > > ajax callbacks :)
> > >
> > > According to this doc the error callback is:
> > > "A function to be called if the request fails"
> > >
> > > In the case I'm exposing, obviously the request is not failing so the
> > error
> > > I'm getting should be handled in the success callback. Please, tell me
> if
> > > there is another way to do it.
> > > I found a js function in the CheckoutProcess.js called
> > getServerError(...)
> > > which is never invoked. I think it should be included in the success
> > > callback like the following code:
> > >
> > > (chekoutProcess.js)
> > >
> > > // Check server side error
> > > function getServerError(data) {
> > >var serverErrorHash = [];
> > >var serverError = "";
> > >if (data._ERROR_MES

Re: Issue with ajax and json response

2011-08-28 Thread Atul Vani
Jonatan,

IMO, the event you invoked in your request mapping should be fixed to return 
error response, when they get errors. It will cause the error response to be 
rendered instead of the success. Then you can use type="request" value="json" 
for the error response. The responseText recieved by the ajax will be a JSON 
String. You can then pass this JSON string to the getServerError() function to 
extract and return error message(s). I don't know if this information will be 
useful to you or not, as I haven't seen the code, but this is pretty much all 
one needs to check :)


- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Saturday, August 27, 2011 3:51:58 PM
Subject: Re: Issue with ajax and json response

Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no matters what
kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, where can I
find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani wrote:

> Jonatan,
>
> I think if you use
> 
> (it is used in several places in ecommerce and other components'
> controller.xml)
>
> and then use the getServerError() function
> (used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
> to parse the JSON response,
> then you should be able to retrieve the error message to display it to the
> user.
>
> I'm not sure if it will be helpful, I didn't got the problem completely
> either ;-)
>
>
> - Original Message -----
> From: "Jonatan Soto" 
> To: user@ofbiz.apache.org
> Sent: Sunday, July 17, 2011 5:56:10 PM
> Subject: Re: Issue with ajax and json response
>
> Done. Patch provided, not fully tested.
> https://issues.apache.org/jira/browse/OFBIZ-4342
>
> <https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,
>
>
> On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray  >wrote:
>
> > Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
> > be great if you could create a jira issue so this doesn't get lost.
> >
> > Regards
> > Scott
> >
> > HotWax Media
> > http://www.hotwaxmedia.com
> >
> > On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
> >
> > > Well, I did a little read on the jquery ajax documentation (
> > > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> > wrong.
> > > It is definitively not related to
> > > the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when
> I
> > > realized that the result the controller returns has nothing to do with
> > the
> > > ajax callbacks :)
> > >
> > > According to this doc the error callback is:
> > > "A function to be called if the request fails"
> > >
> > > In the case I'm exposing, obviously the request is not failing so the
> > error
> > > I'm getting should be handled in the success callback. Please, tell me
> if
> > > there is another way to do it.
> > > I found a js function in the CheckoutProcess.js called
> > getServerError(...)
> > > which is never invoked. I think it should be included in the success
> > > callback like the following code:
> > >
> > > (chekoutProcess.js)
> > >
> > > // Check server side error
> > > function getServerError(data) {
> > >var serverErrorHash = [];
> > >var serverError = "";
> > >if (data._ERROR_MESSAGE_LIST_ != undefined) {
> > >serverErrorHash = data._ERROR_MESSAGE_LIST_;
> > >jQuery.each(serverErrorHash, function(i, error) {
> > >serverError += error.message + '';
> > >});
> > >}
> > >if (data._ERROR_MESSAGE_ != undefined) {
> > >serverError = data._ERROR_MESSAGE_;
> > >}
> > >return serverError;
> > > }
> > >
> > > function createUpdateCustomerAndShippingAddress() {
> > >var result = false;
> > >jQuery.ajax({
> > >url: 'createUpdateShippingAddress',
> > >type: 'POST',
> > >dataType: 'json',
> > >async: false,
> > >data: jQuery('#shippingForm').serialize(),
> > >success: function(json) {
> > > var serverError = getServerErr

Re: Issue with ajax and json response

2011-08-28 Thread Jonatan Soto
sorry about that. I should change the eclipse formatter rules to meet Ofbiz
format specs. I did it for another workspace but not for the current one I'm
using. Well, I will provide a new patch correcting this ASAP.

On Sun, Aug 28, 2011 at 11:02 AM, Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Also I think  there are some tabs in your patch (I can see them because
> your file is automatically rendered in browsers)
> I see some
> jQuery('#**shippingFormServerError').**html(serverError);
> lines wrongly formatted
>
> Jacques
>
>
> Jacques Le Roux wrote:
>
>> Hi Jonatan,
>>
>> Your patch looks good at 1st glance, but you say below "not fully tested"
>> what do you mean by that? Do we need to test something
>> which could be specifically missing or has not been tested, or is it just
>> a point in the dark?
>>
>> Thanks
>>
>> Jacques
>>
>> Jonatan Soto wrote:
>>
>>> Hi Atul,
>>>
>>> I've didn't got server error messages using what you said. Probably is
>>> something wrong in my code, but what I have noticed is that no matters
>>> what
>>> kind of response I set, the 'success' callback method is called.
>>> Anyway, how is handled the server response in this case? I mean, where
>>> can I
>>> find the code where the getServerError() JS function is called once we
>>> return the error response?
>>>
>>> Many thanks Atul.
>>>
>>> On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani **
>>> wrote:
>>>
>>>  Jonatan,
>>>>
>>>> I think if you use
>>>> 
>>>> (it is used in several places in ecommerce and other components'
>>>> controller.xml)
>>>>
>>>> and then use the getServerError() function
>>>> (used in specialpurpose/ecommerce/**webapp/ecommerce/images/**
>>>> profile.js)
>>>> to parse the JSON response,
>>>> then you should be able to retrieve the error message to display it to
>>>> the
>>>> user.
>>>>
>>>> I'm not sure if it will be helpful, I didn't got the problem completely
>>>> either ;-)
>>>>
>>>>
>>>> - Original Message -
>>>> From: "Jonatan Soto" 
>>>> To: user@ofbiz.apache.org
>>>> Sent: Sunday, July 17, 2011 5:56:10 PM
>>>> Subject: Re: Issue with ajax and json response
>>>>
>>>> Done. Patch provided, not fully tested.
>>>> https://issues.apache.org/**jira/browse/OFBIZ-4342<https://issues.apache.org/jira/browse/OFBIZ-4342>
>>>>
>>>> <https://issues.apache.org/**jira/browse/OFBIZ-4342<https://issues.apache.org/jira/browse/OFBIZ-4342>
>>>> >**Regards,
>>>>
>>>>
>>>> On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray >>>
>>>>> wrote:
>>>>>
>>>>
>>>>  Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go,
>>>>> would
>>>>> be great if you could create a jira issue so this doesn't get lost.
>>>>>
>>>>> Regards
>>>>> Scott
>>>>>
>>>>> HotWax Media
>>>>> http://www.hotwaxmedia.com
>>>>>
>>>>> On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
>>>>>
>>>>>  Well, I did a little read on the jquery ajax documentation (
>>>>>> http://api.jquery.com/jQuery.**ajax/<http://api.jquery.com/jQuery.ajax/>)
>>>>>>  and some of my assertions were wrong.
>>>>>> It is definitively not related to
>>>>>> the CommonEvents#**jsonResponseFromRequestAttribu**tes. I felt stupid
>>>>>> when I
>>>>>> realized that the result the controller returns has nothing to do with
>>>>>> the
>>>>>> ajax callbacks :)
>>>>>>
>>>>>> According to this doc the error callback is:
>>>>>> "A function to be called if the request fails"
>>>>>>
>>>>>> In the case I'm exposing, obviously the request is not failing so the
>>>>>> error
>>>>>> I'm getting should be handled in the success callback. Please, tell me
>>>>>> if
>>>>>> there is another way to do it.
>>>>>> I found a js function in the CheckoutProcess.js called
>

Re: Issue with ajax and json response

2011-08-28 Thread Jonatan Soto
Hi Jacques,

You're right I didn't specified what is not tested. What I meant is that I
tested a few JS methods where I've applied the changes. Other methods aren't
tested because I am not using them and didn't have time to see where they
are used. Note that I've changed only the JS functions where ajax calls are
invoked and I implemented the same logic for all of them, so they should
work :)

Here is the list of these methods I haven't tested for sure:

- getProductLineItemIndex
- addPromoCode

On Sun, Aug 28, 2011 at 10:49 AM, Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Hi Jonatan,
>
> Your patch looks good at 1st glance, but you say below "not fully tested"
> what do you mean by that? Do we need to test something which could be
> specifically missing or has not been tested, or is it just a point in the
> dark?
>
> Thanks
>
> Jacques
>
>
> Jonatan Soto wrote:
>
>> Hi Atul,
>>
>> I've didn't got server error messages using what you said. Probably is
>> something wrong in my code, but what I have noticed is that no matters
>> what
>> kind of response I set, the 'success' callback method is called.
>> Anyway, how is handled the server response in this case? I mean, where can
>> I
>> find the code where the getServerError() JS function is called once we
>> return the error response?
>>
>> Many thanks Atul.
>>
>> On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani **
>> wrote:
>>
>>  Jonatan,
>>>
>>> I think if you use
>>> 
>>> (it is used in several places in ecommerce and other components'
>>> controller.xml)
>>>
>>> and then use the getServerError() function
>>> (used in specialpurpose/ecommerce/**webapp/ecommerce/images/**
>>> profile.js)
>>> to parse the JSON response,
>>> then you should be able to retrieve the error message to display it to
>>> the
>>> user.
>>>
>>> I'm not sure if it will be helpful, I didn't got the problem completely
>>> either ;-)
>>>
>>>
>>> - Original Message -
>>> From: "Jonatan Soto" 
>>> To: user@ofbiz.apache.org
>>> Sent: Sunday, July 17, 2011 5:56:10 PM
>>> Subject: Re: Issue with ajax and json response
>>>
>>> Done. Patch provided, not fully tested.
>>> https://issues.apache.org/**jira/browse/OFBIZ-4342<https://issues.apache.org/jira/browse/OFBIZ-4342>
>>>
>>> <https://issues.apache.org/**jira/browse/OFBIZ-4342<https://issues.apache.org/jira/browse/OFBIZ-4342>
>>> >**Regards,
>>>
>>>
>>> On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray >>
>>>> wrote:
>>>>
>>>
>>>  Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go,
>>>> would
>>>> be great if you could create a jira issue so this doesn't get lost.
>>>>
>>>> Regards
>>>> Scott
>>>>
>>>> HotWax Media
>>>> http://www.hotwaxmedia.com
>>>>
>>>> On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
>>>>
>>>>  Well, I did a little read on the jquery ajax documentation (
>>>>> http://api.jquery.com/jQuery.**ajax/<http://api.jquery.com/jQuery.ajax/>)
>>>>>  and some of my assertions were wrong.
>>>>> It is definitively not related to
>>>>> the CommonEvents#**jsonResponseFromRequestAttribu**tes. I felt stupid
>>>>> when I
>>>>> realized that the result the controller returns has nothing to do with
>>>>> the
>>>>> ajax callbacks :)
>>>>>
>>>>> According to this doc the error callback is:
>>>>> "A function to be called if the request fails"
>>>>>
>>>>> In the case I'm exposing, obviously the request is not failing so the
>>>>> error
>>>>> I'm getting should be handled in the success callback. Please, tell me
>>>>> if
>>>>> there is another way to do it.
>>>>> I found a js function in the CheckoutProcess.js called
>>>>> getServerError(...)
>>>>> which is never invoked. I think it should be included in the success
>>>>> callback like the following code:
>>>>>
>>>>> (chekoutProcess.js)
>>>>>
>>>>> // Check server side error
>>>>> function getServerError(data) {
>>>>

Re: Issue with ajax and json response

2011-08-28 Thread Jacques Le Roux

Also I think  there are some tabs in your patch (I can see them because your 
file is automatically rendered in browsers)
I see some
jQuery('#shippingFormServerError').html(serverError);
lines wrongly formatted

Jacques

Jacques Le Roux wrote:

Hi Jonatan,

Your patch looks good at 1st glance, but you say below "not fully tested" what 
do you mean by that? Do we need to test something
which could be specifically missing or has not been tested, or is it just a 
point in the dark?

Thanks

Jacques

Jonatan Soto wrote:

Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no matters what
kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, where can I
find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani wrote:


Jonatan,

I think if you use

(it is used in several places in ecommerce and other components'
controller.xml)

and then use the getServerError() function
(used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
to parse the JSON response,
then you should be able to retrieve the error message to display it to the
user.

I'm not sure if it will be helpful, I didn't got the problem completely
either ;-)


- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Sunday, July 17, 2011 5:56:10 PM
Subject: Re: Issue with ajax and json response

Done. Patch provided, not fully tested.
https://issues.apache.org/jira/browse/OFBIZ-4342

<https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,


On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray 
wrote:



Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
be great if you could create a jira issue so this doesn't get lost.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:


Well, I did a little read on the jquery ajax documentation (
http://api.jquery.com/jQuery.ajax/)  and some of my assertions were wrong.
It is definitively not related to
the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
realized that the result the controller returns has nothing to do with the
ajax callbacks :)

According to this doc the error callback is:
"A function to be called if the request fails"

In the case I'm exposing, obviously the request is not failing so the error
I'm getting should be handled in the success callback. Please, tell me if
there is another way to do it.
I found a js function in the CheckoutProcess.js called getServerError(...)
which is never invoked. I think it should be included in the success
callback like the following code:

(chekoutProcess.js)

// Check server side error
function getServerError(data) {
   var serverErrorHash = [];
   var serverError = "";
   if (data._ERROR_MESSAGE_LIST_ != undefined) {
   serverErrorHash = data._ERROR_MESSAGE_LIST_;
   jQuery.each(serverErrorHash, function(i, error) {
   serverError += error.message + '';
   });
   }
   if (data._ERROR_MESSAGE_ != undefined) {
   serverError = data._ERROR_MESSAGE_;
   }
   return serverError;
}

function createUpdateCustomerAndShippingAddress() {
   var result = false;
   jQuery.ajax({
   url: 'createUpdateShippingAddress',
   type: 'POST',
   dataType: 'json',
   async: false,
   data: jQuery('#shippingForm').serialize(),
   success: function(json) {
var serverError = getServerError(json);
if (!serverError) {
   jQuery('#shippingFormServerError').fadeOut('fast');
   // Process Shipping data response.
   jQuery('#shipToPartyId').val(json.partyId);
   jQuery('#billToPartyId').val(json.partyId);
   jQuery('#shipToContactMechId').val(json.contactMechId);

jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
   jQuery('#emailContactMechId').val(json.emailContactMechId);

//jQuery('#completedShippingMethod').html(json.shippingDescription);
   updateShippingSummary();
   getShipOptions();
   result = true;
} else {
   jQuery('#shippingFormServerError').html(serverError);


 jQuery('#shippingFormServerError').css("display","block");

   result = false;
}
   },
   error: function(error) {
   if (error != "") {
   jQuery('#shippingFormServerError').html(error);
   }
   result = false;
   }
   });
   return result;
}

Now with this modifications I am showing the server side error messages

Re: Issue with ajax and json response

2011-08-28 Thread Jacques Le Roux

Hi Jonatan,

Your patch looks good at 1st glance, but you say below "not fully tested" what do you mean by that? Do we need to test something 
which could be specifically missing or has not been tested, or is it just a point in the dark?


Thanks

Jacques

Jonatan Soto wrote:

Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no matters what
kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, where can I
find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani wrote:


Jonatan,

I think if you use

(it is used in several places in ecommerce and other components'
controller.xml)

and then use the getServerError() function
(used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
to parse the JSON response,
then you should be able to retrieve the error message to display it to the
user.

I'm not sure if it will be helpful, I didn't got the problem completely
either ;-)


- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Sunday, July 17, 2011 5:56:10 PM
Subject: Re: Issue with ajax and json response

Done. Patch provided, not fully tested.
https://issues.apache.org/jira/browse/OFBIZ-4342

<https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,


On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray 
wrote:



Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
be great if you could create a jira issue so this doesn't get lost.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:


Well, I did a little read on the jquery ajax documentation (
http://api.jquery.com/jQuery.ajax/)  and some of my assertions were wrong.
It is definitively not related to
the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
realized that the result the controller returns has nothing to do with the
ajax callbacks :)

According to this doc the error callback is:
"A function to be called if the request fails"

In the case I'm exposing, obviously the request is not failing so the error
I'm getting should be handled in the success callback. Please, tell me if
there is another way to do it.
I found a js function in the CheckoutProcess.js called getServerError(...)
which is never invoked. I think it should be included in the success
callback like the following code:

(chekoutProcess.js)

// Check server side error
function getServerError(data) {
   var serverErrorHash = [];
   var serverError = "";
   if (data._ERROR_MESSAGE_LIST_ != undefined) {
   serverErrorHash = data._ERROR_MESSAGE_LIST_;
   jQuery.each(serverErrorHash, function(i, error) {
   serverError += error.message + '';
   });
   }
   if (data._ERROR_MESSAGE_ != undefined) {
   serverError = data._ERROR_MESSAGE_;
   }
   return serverError;
}

function createUpdateCustomerAndShippingAddress() {
   var result = false;
   jQuery.ajax({
   url: 'createUpdateShippingAddress',
   type: 'POST',
   dataType: 'json',
   async: false,
   data: jQuery('#shippingForm').serialize(),
   success: function(json) {
var serverError = getServerError(json);
if (!serverError) {
   jQuery('#shippingFormServerError').fadeOut('fast');
   // Process Shipping data response.
   jQuery('#shipToPartyId').val(json.partyId);
   jQuery('#billToPartyId').val(json.partyId);
   jQuery('#shipToContactMechId').val(json.contactMechId);

jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
   jQuery('#emailContactMechId').val(json.emailContactMechId);

//jQuery('#completedShippingMethod').html(json.shippingDescription);
   updateShippingSummary();
   getShipOptions();
   result = true;
} else {
   jQuery('#shippingFormServerError').html(serverError);


 jQuery('#shippingFormServerError').css("display","block");

   result = false;
}
   },
   error: function(error) {
   if (error != "") {
   jQuery('#shippingFormServerError').html(error);
   }
   result = false;
   }
   });
   return result;
}

Now with this modifications I am showing the server side error messages
correctly.


HTH


On Sat, Jul 16, 2011 at 8:28 PM, Jonatan Soto < seniledemen...@gmail.com
wrote:


Hi BJ,

The setAnonuserLogin is an ECA triggered before. The problem is after it if
I'm not wrong.

Look at:
2011-07-16 19:44:35,399 (http-0.0.0.0-

Re: Issue with ajax and json response

2011-08-27 Thread Jonatan Soto
Hi Atul,

I've didn't got server error messages using what you said. Probably is
something wrong in my code, but what I have noticed is that no matters what
kind of response I set, the 'success' callback method is called.
Anyway, how is handled the server response in this case? I mean, where can I
find the code where the getServerError() JS function is called once we
return the error response?

Many thanks Atul.

On Fri, Aug 26, 2011 at 7:32 PM, Atul Vani wrote:

> Jonatan,
>
> I think if you use
> 
> (it is used in several places in ecommerce and other components'
> controller.xml)
>
> and then use the getServerError() function
> (used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
> to parse the JSON response,
> then you should be able to retrieve the error message to display it to the
> user.
>
> I'm not sure if it will be helpful, I didn't got the problem completely
> either ;-)
>
>
> - Original Message -
> From: "Jonatan Soto" 
> To: user@ofbiz.apache.org
> Sent: Sunday, July 17, 2011 5:56:10 PM
> Subject: Re: Issue with ajax and json response
>
> Done. Patch provided, not fully tested.
> https://issues.apache.org/jira/browse/OFBIZ-4342
>
> <https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,
>
>
> On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray  >wrote:
>
> > Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
> > be great if you could create a jira issue so this doesn't get lost.
> >
> > Regards
> > Scott
> >
> > HotWax Media
> > http://www.hotwaxmedia.com
> >
> > On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
> >
> > > Well, I did a little read on the jquery ajax documentation (
> > > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> > wrong.
> > > It is definitively not related to
> > > the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when
> I
> > > realized that the result the controller returns has nothing to do with
> > the
> > > ajax callbacks :)
> > >
> > > According to this doc the error callback is:
> > > "A function to be called if the request fails"
> > >
> > > In the case I'm exposing, obviously the request is not failing so the
> > error
> > > I'm getting should be handled in the success callback. Please, tell me
> if
> > > there is another way to do it.
> > > I found a js function in the CheckoutProcess.js called
> > getServerError(...)
> > > which is never invoked. I think it should be included in the success
> > > callback like the following code:
> > >
> > > (chekoutProcess.js)
> > >
> > > // Check server side error
> > > function getServerError(data) {
> > >var serverErrorHash = [];
> > >var serverError = "";
> > >if (data._ERROR_MESSAGE_LIST_ != undefined) {
> > >serverErrorHash = data._ERROR_MESSAGE_LIST_;
> > >jQuery.each(serverErrorHash, function(i, error) {
> > >serverError += error.message + '';
> > >});
> > >}
> > >if (data._ERROR_MESSAGE_ != undefined) {
> > >serverError = data._ERROR_MESSAGE_;
> > >}
> > >return serverError;
> > > }
> > >
> > > function createUpdateCustomerAndShippingAddress() {
> > >var result = false;
> > >jQuery.ajax({
> > >url: 'createUpdateShippingAddress',
> > >type: 'POST',
> > >dataType: 'json',
> > >async: false,
> > >data: jQuery('#shippingForm').serialize(),
> > >success: function(json) {
> > > var serverError = getServerError(json);
> > > if (!serverError) {
> > >jQuery('#shippingFormServerError').fadeOut('fast');
> > >// Process Shipping data response.
> > >jQuery('#shipToPartyId').val(json.partyId);
> > >jQuery('#billToPartyId').val(json.partyId);
> > >jQuery('#shipToContactMechId').val(json.contactMechId);
> > >
> > > jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
> > >jQuery('#emailContactMechId').val(json.emailContactMechId);
> > >
> > > //jQuery('#completedShippingMethod').html(json.shippingDescription);
> > >

Re: Issue with ajax and json response

2011-08-26 Thread Atul Vani
Jonatan,

I think if you use 

(it is used in several places in ecommerce and other components' controller.xml)

and then use the getServerError() function
(used in specialpurpose/ecommerce/webapp/ecommerce/images/profile.js)
to parse the JSON response,
then you should be able to retrieve the error message to display it to the user.

I'm not sure if it will be helpful, I didn't got the problem completely either 
;-)


- Original Message -
From: "Jonatan Soto" 
To: user@ofbiz.apache.org
Sent: Sunday, July 17, 2011 5:56:10 PM
Subject: Re: Issue with ajax and json response

Done. Patch provided, not fully tested.
https://issues.apache.org/jira/browse/OFBIZ-4342

<https://issues.apache.org/jira/browse/OFBIZ-4342>Regards,


On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray wrote:

> Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
> be great if you could create a jira issue so this doesn't get lost.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
>
> > Well, I did a little read on the jquery ajax documentation (
> > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> wrong.
> > It is definitively not related to
> > the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
> > realized that the result the controller returns has nothing to do with
> the
> > ajax callbacks :)
> >
> > According to this doc the error callback is:
> > "A function to be called if the request fails"
> >
> > In the case I'm exposing, obviously the request is not failing so the
> error
> > I'm getting should be handled in the success callback. Please, tell me if
> > there is another way to do it.
> > I found a js function in the CheckoutProcess.js called
> getServerError(...)
> > which is never invoked. I think it should be included in the success
> > callback like the following code:
> >
> > (chekoutProcess.js)
> >
> > // Check server side error
> > function getServerError(data) {
> >var serverErrorHash = [];
> >var serverError = "";
> >if (data._ERROR_MESSAGE_LIST_ != undefined) {
> >serverErrorHash = data._ERROR_MESSAGE_LIST_;
> >jQuery.each(serverErrorHash, function(i, error) {
> >serverError += error.message + '';
> >});
> >}
> >if (data._ERROR_MESSAGE_ != undefined) {
> >serverError = data._ERROR_MESSAGE_;
> >}
> >return serverError;
> > }
> >
> > function createUpdateCustomerAndShippingAddress() {
> >var result = false;
> >jQuery.ajax({
> >url: 'createUpdateShippingAddress',
> >type: 'POST',
> >dataType: 'json',
> >async: false,
> >data: jQuery('#shippingForm').serialize(),
> >success: function(json) {
> > var serverError = getServerError(json);
> > if (!serverError) {
> >jQuery('#shippingFormServerError').fadeOut('fast');
> >// Process Shipping data response.
> >jQuery('#shipToPartyId').val(json.partyId);
> >jQuery('#billToPartyId').val(json.partyId);
> >jQuery('#shipToContactMechId').val(json.contactMechId);
> >
> > jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
> >jQuery('#emailContactMechId').val(json.emailContactMechId);
> >
> > //jQuery('#completedShippingMethod').html(json.shippingDescription);
> >updateShippingSummary();
> >getShipOptions();
> >result = true;
> > } else {
> >jQuery('#shippingFormServerError').html(serverError);
> >jQuery('#shippingFormServerError').css("display","block");
> >result = false;
> > }
> >},
> >error: function(error) {
> >if (error != "") {
> >jQuery('#shippingFormServerError').html(error);
> >}
> >result = false;
> >}
> >});
> >return result;
> > }
> >
> > Now with this modifications I am showing the server side error messages
> > correctly.
> >
> >
> > HTH
> >
> >
> > On Sat, Jul 16, 2011 at 8:28 PM, Jonatan Soto  >wrote:
> >
> >> Hi BJ,
> >>

Re: Issue with ajax and json response

2011-07-17 Thread Jonatan Soto
Done. Patch provided, not fully tested.
https://issues.apache.org/jira/browse/OFBIZ-4342

Regards,


On Sun, Jul 17, 2011 at 1:34 PM, Scott Gray wrote:

> Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would
> be great if you could create a jira issue so this doesn't get lost.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:
>
> > Well, I did a little read on the jquery ajax documentation (
> > http://api.jquery.com/jQuery.ajax/)  and some of my assertions were
> wrong.
> > It is definitively not related to
> > the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
> > realized that the result the controller returns has nothing to do with
> the
> > ajax callbacks :)
> >
> > According to this doc the error callback is:
> > "A function to be called if the request fails"
> >
> > In the case I'm exposing, obviously the request is not failing so the
> error
> > I'm getting should be handled in the success callback. Please, tell me if
> > there is another way to do it.
> > I found a js function in the CheckoutProcess.js called
> getServerError(...)
> > which is never invoked. I think it should be included in the success
> > callback like the following code:
> >
> > (chekoutProcess.js)
> >
> > // Check server side error
> > function getServerError(data) {
> >var serverErrorHash = [];
> >var serverError = "";
> >if (data._ERROR_MESSAGE_LIST_ != undefined) {
> >serverErrorHash = data._ERROR_MESSAGE_LIST_;
> >jQuery.each(serverErrorHash, function(i, error) {
> >serverError += error.message + '';
> >});
> >}
> >if (data._ERROR_MESSAGE_ != undefined) {
> >serverError = data._ERROR_MESSAGE_;
> >}
> >return serverError;
> > }
> >
> > function createUpdateCustomerAndShippingAddress() {
> >var result = false;
> >jQuery.ajax({
> >url: 'createUpdateShippingAddress',
> >type: 'POST',
> >dataType: 'json',
> >async: false,
> >data: jQuery('#shippingForm').serialize(),
> >success: function(json) {
> > var serverError = getServerError(json);
> > if (!serverError) {
> >jQuery('#shippingFormServerError').fadeOut('fast');
> >// Process Shipping data response.
> >jQuery('#shipToPartyId').val(json.partyId);
> >jQuery('#billToPartyId').val(json.partyId);
> >jQuery('#shipToContactMechId').val(json.contactMechId);
> >
> > jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
> >jQuery('#emailContactMechId').val(json.emailContactMechId);
> >
> > //jQuery('#completedShippingMethod').html(json.shippingDescription);
> >updateShippingSummary();
> >getShipOptions();
> >result = true;
> > } else {
> >jQuery('#shippingFormServerError').html(serverError);
> >jQuery('#shippingFormServerError').css("display","block");
> >result = false;
> > }
> >},
> >error: function(error) {
> >if (error != "") {
> >jQuery('#shippingFormServerError').html(error);
> >}
> >result = false;
> >}
> >});
> >return result;
> > }
> >
> > Now with this modifications I am showing the server side error messages
> > correctly.
> >
> >
> > HTH
> >
> >
> > On Sat, Jul 16, 2011 at 8:28 PM, Jonatan Soto  >wrote:
> >
> >> Hi BJ,
> >>
> >> The setAnonuserLogin is an ECA triggered before. The problem is after it
> if
> >> I'm not wrong.
> >>
> >> Look at:
> >> 2011-07-16 19:44:35,399 (http-0.0.0.0-8443-2) [
> >> ServiceDispatcher.java:599:INFO ] Sync service
> >> [traditional#JF/createUpdateCustomerAndShippingAddress] finished in
> [112]
> >> milliseconds with response [{errorMessageList={Area code is missing,
> Falta
> >> Teléfono de Contacto}, responseMessage=error}]
> >> ...
> >> 2011-07-16 19:44:35,504 (http-0.0.0.0-8443-2) [
> >> RequestHandler.java:639:INFO ] Ran Event
> >> [java:org.ofbiz.common.CommonEvents#jsonResponseFromRequestAttributes]
> from
> >> [request], result is [success]
> >>
> >> The service that is called from ajax is returning 'error' but the
> chained
> >> json request is returning 'success'. I guess this is the problem.
> >>
> >> Thanks anyway!
> >>
> >>
> >> On Sat, Jul 16, 2011 at 8:18 PM, BJ Freeman 
> wrote:
> >>
> >>> [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
> >>> response [{responseMessage=success}]
> >>>
> >>> it is evaluating a good lognin. this is where to debug.
> >>>
> >>> Jonatan Soto sent the following on 7/16/2011 10:59 AM:
>  Hi all,
> 
>  I am customizing the onePageCheckout (the anonymous part) and I found
>  something strange. I've changed the client-side validation in order to
> >>> allow
>  the customer to only introduce the phone, cell phone

Re: Issue with ajax and json response

2011-07-17 Thread Scott Gray
Yeah, checking for the _ERROR_MESSAGE* keys is the right way to go, would be 
great if you could create a jira issue so this doesn't get lost.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 17/07/2011, at 7:56 AM, Jonatan Soto wrote:

> Well, I did a little read on the jquery ajax documentation (
> http://api.jquery.com/jQuery.ajax/)  and some of my assertions were wrong.
> It is definitively not related to
> the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
> realized that the result the controller returns has nothing to do with the
> ajax callbacks :)
> 
> According to this doc the error callback is:
> "A function to be called if the request fails"
> 
> In the case I'm exposing, obviously the request is not failing so the error
> I'm getting should be handled in the success callback. Please, tell me if
> there is another way to do it.
> I found a js function in the CheckoutProcess.js called getServerError(...)
> which is never invoked. I think it should be included in the success
> callback like the following code:
> 
> (chekoutProcess.js)
> 
> // Check server side error
> function getServerError(data) {
>var serverErrorHash = [];
>var serverError = "";
>if (data._ERROR_MESSAGE_LIST_ != undefined) {
>serverErrorHash = data._ERROR_MESSAGE_LIST_;
>jQuery.each(serverErrorHash, function(i, error) {
>serverError += error.message + '';
>});
>}
>if (data._ERROR_MESSAGE_ != undefined) {
>serverError = data._ERROR_MESSAGE_;
>}
>return serverError;
> }
> 
> function createUpdateCustomerAndShippingAddress() {
>var result = false;
>jQuery.ajax({
>url: 'createUpdateShippingAddress',
>type: 'POST',
>dataType: 'json',
>async: false,
>data: jQuery('#shippingForm').serialize(),
>success: function(json) {
> var serverError = getServerError(json);
> if (!serverError) {
>jQuery('#shippingFormServerError').fadeOut('fast');
>// Process Shipping data response.
>jQuery('#shipToPartyId').val(json.partyId);
>jQuery('#billToPartyId').val(json.partyId);
>jQuery('#shipToContactMechId').val(json.contactMechId);
> 
> jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
>jQuery('#emailContactMechId').val(json.emailContactMechId);
> 
> //jQuery('#completedShippingMethod').html(json.shippingDescription);
>updateShippingSummary();
>getShipOptions();
>result = true;
> } else {
>jQuery('#shippingFormServerError').html(serverError);
>jQuery('#shippingFormServerError').css("display","block");
>result = false;
> }
>},
>error: function(error) {
>if (error != "") {
>jQuery('#shippingFormServerError').html(error);
>}
>result = false;
>}
>});
>return result;
> }
> 
> Now with this modifications I am showing the server side error messages
> correctly.
> 
> 
> HTH
> 
> 
> On Sat, Jul 16, 2011 at 8:28 PM, Jonatan Soto wrote:
> 
>> Hi BJ,
>> 
>> The setAnonuserLogin is an ECA triggered before. The problem is after it if
>> I'm not wrong.
>> 
>> Look at:
>> 2011-07-16 19:44:35,399 (http-0.0.0.0-8443-2) [
>> ServiceDispatcher.java:599:INFO ] Sync service
>> [traditional#JF/createUpdateCustomerAndShippingAddress] finished in [112]
>> milliseconds with response [{errorMessageList={Area code is missing, Falta
>> Teléfono de Contacto}, responseMessage=error}]
>> ...
>> 2011-07-16 19:44:35,504 (http-0.0.0.0-8443-2) [
>> RequestHandler.java:639:INFO ] Ran Event
>> [java:org.ofbiz.common.CommonEvents#jsonResponseFromRequestAttributes] from
>> [request], result is [success]
>> 
>> The service that is called from ajax is returning 'error' but the chained
>> json request is returning 'success'. I guess this is the problem.
>> 
>> Thanks anyway!
>> 
>> 
>> On Sat, Jul 16, 2011 at 8:18 PM, BJ Freeman  wrote:
>> 
>>> [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
>>> response [{responseMessage=success}]
>>> 
>>> it is evaluating a good lognin. this is where to debug.
>>> 
>>> Jonatan Soto sent the following on 7/16/2011 10:59 AM:
 Hi all,
 
 I am customizing the onePageCheckout (the anonymous part) and I found
 something strange. I've changed the client-side validation in order to
>>> allow
 the customer to only introduce the phone, cell phone or both. But on
 server-side I didn't change anything in the PartyContactMechMapProcs.xml
 yet. So, it is throwing an error of course, but the ajax handler does
>>> not
 consider it as an error. It always executes the success ajax handler!
 
 This is the stack trace:
 
 2011-07-16 19:44:35,266 (http-0.0.0.0-8443-2) [
 ControlServlet.java:141:INFO ] [[[createUpdateShippingAddress] Request
 Begun, encoding=[UTF-8]- total:0

Re: Issue with ajax and json response

2011-07-16 Thread BJ Freeman
I believe that the UI ajax uses data supplied by ftls, no calls fron the
UI access the ofbiz internals and goes through the Controller.
the ajex and jazon used past the controller URI is internal to ofbiz and
is not exposed to the UI. There is a Handler to deal with ajax and
jason, internal to ofbiz.

The ECA is internal to ofbiz and it returns a success that is evaluate
by the event/service that spawned it.
So something in the ECA called script is not evaluating login data
correctly.

that is as much as I know.



Jonatan Soto sent the following on 7/16/2011 12:56 PM:
> Well, I did a little read on the jquery ajax documentation (
> http://api.jquery.com/jQuery.ajax/)  and some of my assertions were wrong.
> It is definitively not related to
> the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
> realized that the result the controller returns has nothing to do with the
> ajax callbacks :)
> 
> According to this doc the error callback is:
> "A function to be called if the request fails"
> 
> In the case I'm exposing, obviously the request is not failing so the error
> I'm getting should be handled in the success callback. Please, tell me if
> there is another way to do it.
> I found a js function in the CheckoutProcess.js called getServerError(...)
> which is never invoked. I think it should be included in the success
> callback like the following code:
> 
> (chekoutProcess.js)
> 
> // Check server side error
> function getServerError(data) {
> var serverErrorHash = [];
> var serverError = "";
> if (data._ERROR_MESSAGE_LIST_ != undefined) {
> serverErrorHash = data._ERROR_MESSAGE_LIST_;
> jQuery.each(serverErrorHash, function(i, error) {
> serverError += error.message + '';
> });
> }
> if (data._ERROR_MESSAGE_ != undefined) {
> serverError = data._ERROR_MESSAGE_;
> }
> return serverError;
> }
> 
> function createUpdateCustomerAndShippingAddress() {
> var result = false;
> jQuery.ajax({
> url: 'createUpdateShippingAddress',
> type: 'POST',
> dataType: 'json',
> async: false,
> data: jQuery('#shippingForm').serialize(),
> success: function(json) {
>  var serverError = getServerError(json);
>  if (!serverError) {
> jQuery('#shippingFormServerError').fadeOut('fast');
> // Process Shipping data response.
> jQuery('#shipToPartyId').val(json.partyId);
> jQuery('#billToPartyId').val(json.partyId);
> jQuery('#shipToContactMechId').val(json.contactMechId);
> 
>  jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
> jQuery('#emailContactMechId').val(json.emailContactMechId);
> 
>  //jQuery('#completedShippingMethod').html(json.shippingDescription);
> updateShippingSummary();
> getShipOptions();
> result = true;
>  } else {
> jQuery('#shippingFormServerError').html(serverError);
> jQuery('#shippingFormServerError').css("display","block");
> result = false;
>  }
> },
> error: function(error) {
> if (error != "") {
> jQuery('#shippingFormServerError').html(error);
> }
> result = false;
> }
> });
> return result;
> }
> 
> Now with this modifications I am showing the server side error messages
> correctly.
> 
> 
> HTH
> 
> 
> On Sat, Jul 16, 2011 at 8:28 PM, Jonatan Soto wrote:
> 
>> Hi BJ,
>>
>> The setAnonuserLogin is an ECA triggered before. The problem is after it if
>> I'm not wrong.
>>
>> Look at:
>> 2011-07-16 19:44:35,399 (http-0.0.0.0-8443-2) [
>>  ServiceDispatcher.java:599:INFO ] Sync service
>> [traditional#JF/createUpdateCustomerAndShippingAddress] finished in [112]
>> milliseconds with response [{errorMessageList={Area code is missing, Falta
>> Teléfono de Contacto}, responseMessage=error}]
>> ...
>> 2011-07-16 19:44:35,504 (http-0.0.0.0-8443-2) [
>> RequestHandler.java:639:INFO ] Ran Event
>> [java:org.ofbiz.common.CommonEvents#jsonResponseFromRequestAttributes] from
>> [request], result is [success]
>>
>> The service that is called from ajax is returning 'error' but the chained
>> json request is returning 'success'. I guess this is the problem.
>>
>> Thanks anyway!
>>
>>
>> On Sat, Jul 16, 2011 at 8:18 PM, BJ Freeman  wrote:
>>
>>> [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
>>> response [{responseMessage=success}]
>>>
>>> it is evaluating a good lognin. this is where to debug.
>>>
>>> Jonatan Soto sent the following on 7/16/2011 10:59 AM:
 Hi all,

 I am customizing the onePageCheckout (the anonymous part) and I found
 something strange. I've changed the client-side validation in order to
>>> allow
 the customer to only introduce the phone, cell phone or both. But on
 server-side I didn't change anything in the PartyContactMechMapProcs.xml

Re: Issue with ajax and json response

2011-07-16 Thread Jonatan Soto
Well, I did a little read on the jquery ajax documentation (
http://api.jquery.com/jQuery.ajax/)  and some of my assertions were wrong.
It is definitively not related to
the CommonEvents#jsonResponseFromRequestAttributes. I felt stupid when I
realized that the result the controller returns has nothing to do with the
ajax callbacks :)

According to this doc the error callback is:
"A function to be called if the request fails"

In the case I'm exposing, obviously the request is not failing so the error
I'm getting should be handled in the success callback. Please, tell me if
there is another way to do it.
I found a js function in the CheckoutProcess.js called getServerError(...)
which is never invoked. I think it should be included in the success
callback like the following code:

(chekoutProcess.js)

// Check server side error
function getServerError(data) {
var serverErrorHash = [];
var serverError = "";
if (data._ERROR_MESSAGE_LIST_ != undefined) {
serverErrorHash = data._ERROR_MESSAGE_LIST_;
jQuery.each(serverErrorHash, function(i, error) {
serverError += error.message + '';
});
}
if (data._ERROR_MESSAGE_ != undefined) {
serverError = data._ERROR_MESSAGE_;
}
return serverError;
}

function createUpdateCustomerAndShippingAddress() {
var result = false;
jQuery.ajax({
url: 'createUpdateShippingAddress',
type: 'POST',
dataType: 'json',
async: false,
data: jQuery('#shippingForm').serialize(),
success: function(json) {
 var serverError = getServerError(json);
 if (!serverError) {
jQuery('#shippingFormServerError').fadeOut('fast');
// Process Shipping data response.
jQuery('#shipToPartyId').val(json.partyId);
jQuery('#billToPartyId').val(json.partyId);
jQuery('#shipToContactMechId').val(json.contactMechId);

 jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId);
jQuery('#emailContactMechId').val(json.emailContactMechId);

 //jQuery('#completedShippingMethod').html(json.shippingDescription);
updateShippingSummary();
getShipOptions();
result = true;
 } else {
jQuery('#shippingFormServerError').html(serverError);
jQuery('#shippingFormServerError').css("display","block");
result = false;
 }
},
error: function(error) {
if (error != "") {
jQuery('#shippingFormServerError').html(error);
}
result = false;
}
});
return result;
}

Now with this modifications I am showing the server side error messages
correctly.


HTH


On Sat, Jul 16, 2011 at 8:28 PM, Jonatan Soto wrote:

> Hi BJ,
>
> The setAnonuserLogin is an ECA triggered before. The problem is after it if
> I'm not wrong.
>
> Look at:
> 2011-07-16 19:44:35,399 (http-0.0.0.0-8443-2) [
>  ServiceDispatcher.java:599:INFO ] Sync service
> [traditional#JF/createUpdateCustomerAndShippingAddress] finished in [112]
> milliseconds with response [{errorMessageList={Area code is missing, Falta
> Teléfono de Contacto}, responseMessage=error}]
> ...
> 2011-07-16 19:44:35,504 (http-0.0.0.0-8443-2) [
> RequestHandler.java:639:INFO ] Ran Event
> [java:org.ofbiz.common.CommonEvents#jsonResponseFromRequestAttributes] from
> [request], result is [success]
>
> The service that is called from ajax is returning 'error' but the chained
> json request is returning 'success'. I guess this is the problem.
>
> Thanks anyway!
>
>
> On Sat, Jul 16, 2011 at 8:18 PM, BJ Freeman  wrote:
>
>> [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
>> response [{responseMessage=success}]
>>
>> it is evaluating a good lognin. this is where to debug.
>>
>> Jonatan Soto sent the following on 7/16/2011 10:59 AM:
>> > Hi all,
>> >
>> > I am customizing the onePageCheckout (the anonymous part) and I found
>> > something strange. I've changed the client-side validation in order to
>> allow
>> > the customer to only introduce the phone, cell phone or both. But on
>> > server-side I didn't change anything in the PartyContactMechMapProcs.xml
>> > yet. So, it is throwing an error of course, but the ajax handler does
>> not
>> > consider it as an error. It always executes the success ajax handler!
>> >
>> > This is the stack trace:
>> >
>> > 2011-07-16 19:44:35,266 (http-0.0.0.0-8443-2) [
>> > ControlServlet.java:141:INFO ] [[[createUpdateShippingAddress] Request
>> > Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
>> > 2011-07-16 19:44:35,283 (http-0.0.0.0-8443-2) [
>> >  ConfigXMLReader.java:120:INFO ] controller loaded: 0.0030s, 281
>> requests,
>> > 96 views in jndi:/0.0.0.0/ecomm/traditional/WEB-INF/controller.xml
>> > 2011-07-16 19:44:35,286 (http-0.0.0.0-8443-2) [
>> > ServiceEcaRule.java:150:INFO ] Running Service ECA Service:
>> > setAnonUserLogin, triggered by rule on Service:
>> > cr

Re: Issue with ajax and json response

2011-07-16 Thread Jonatan Soto
Hi BJ,

The setAnonuserLogin is an ECA triggered before. The problem is after it if
I'm not wrong.

Look at:
2011-07-16 19:44:35,399 (http-0.0.0.0-8443-2) [
 ServiceDispatcher.java:599:INFO ] Sync service
[traditional#JF/createUpdateCustomerAndShippingAddress] finished in [112]
milliseconds with response [{errorMessageList={Area code is missing, Falta
Teléfono de Contacto}, responseMessage=error}]
...
2011-07-16 19:44:35,504 (http-0.0.0.0-8443-2) [
RequestHandler.java:639:INFO ] Ran Event
[java:org.ofbiz.common.CommonEvents#jsonResponseFromRequestAttributes] from
[request], result is [success]

The service that is called from ajax is returning 'error' but the chained
json request is returning 'success'. I guess this is the problem.

Thanks anyway!


On Sat, Jul 16, 2011 at 8:18 PM, BJ Freeman  wrote:

> [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
> response [{responseMessage=success}]
>
> it is evaluating a good lognin. this is where to debug.
>
> Jonatan Soto sent the following on 7/16/2011 10:59 AM:
> > Hi all,
> >
> > I am customizing the onePageCheckout (the anonymous part) and I found
> > something strange. I've changed the client-side validation in order to
> allow
> > the customer to only introduce the phone, cell phone or both. But on
> > server-side I didn't change anything in the PartyContactMechMapProcs.xml
> > yet. So, it is throwing an error of course, but the ajax handler does not
> > consider it as an error. It always executes the success ajax handler!
> >
> > This is the stack trace:
> >
> > 2011-07-16 19:44:35,266 (http-0.0.0.0-8443-2) [
> > ControlServlet.java:141:INFO ] [[[createUpdateShippingAddress] Request
> > Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
> > 2011-07-16 19:44:35,283 (http-0.0.0.0-8443-2) [
> >  ConfigXMLReader.java:120:INFO ] controller loaded: 0.0030s, 281
> requests,
> > 96 views in jndi:/0.0.0.0/ecomm/traditional/WEB-INF/controller.xml
> > 2011-07-16 19:44:35,286 (http-0.0.0.0-8443-2) [
> > ServiceEcaRule.java:150:INFO ] Running Service ECA Service:
> > setAnonUserLogin, triggered by rule on Service:
> > createUpdateCustomerAndShippingAddress
> > 2011-07-16 19:44:35,392 (http-0.0.0.0-8443-2) [
> >  ServiceDispatcher.java:599:INFO ] Sync service
> > [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
> > response [{responseMessage=success}]
> > 2011-07-16 19:44:35,396 (http-0.0.0.0-8443-2) [
> >  TransactionUtil.java:374:WARN ]
> >  exception report
> > --
> > [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
> this
> > stack trace shows where this is happening:
> > Exception: java.lang.Exception
> > Message: Error in simple-method [Create/Update Customer, Shipping Address
> > and other contact details.
> >
> [file:/home/jsoto/workspace/ofbizcustom/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml#createUpdateCustomerAndShippingAddress]]:
> > ; {Area code is missing, Falta Teléfono de Contacto}
> >  stack trace
> > ---
> > java.lang.Exception: Error in simple-method [Create/Update Customer,
> > Shipping Address and other contact details.
> >
> [file:/home/jsoto/workspace/ofbizcustom/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml#createUpdateCustomerAndShippingAddress]]:
> > ; {Area code is missing, Falta Teléfono de Contacto}
> >
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:374)
> >
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:316)
> > org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:870)
> > org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:160)
> > org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:142)
> >
> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.java:78)
> >
> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:53)
> >
> org.ofbiz.service.ModelServiceReader$GenericInvokerImpl.runSync(ModelServiceReader.java:761)
> >
> _$gen.file_58$.home.jsoto.workspace.ofbizcustom.applications.order.servicedef.services_95$checkout_46$xml_35$createUpdateCustomerAndShippingAddress.runSync(file:/home/jsoto/workspace/ofbizcustom/applications/order/servicedef/services_checkout.xml#createUpdateCustomerAndShippingAddress:24)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:399)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:226)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:165)
> >
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:336)
> > org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:638)
> >
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:384)
> > org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:224)
> > org.ofbiz.webapp.co

Re: Issue with ajax and json response

2011-07-16 Thread BJ Freeman
[traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
response [{responseMessage=success}]

it is evaluating a good lognin. this is where to debug.

Jonatan Soto sent the following on 7/16/2011 10:59 AM:
> Hi all,
> 
> I am customizing the onePageCheckout (the anonymous part) and I found
> something strange. I've changed the client-side validation in order to allow
> the customer to only introduce the phone, cell phone or both. But on
> server-side I didn't change anything in the PartyContactMechMapProcs.xml
> yet. So, it is throwing an error of course, but the ajax handler does not
> consider it as an error. It always executes the success ajax handler!
> 
> This is the stack trace:
> 
> 2011-07-16 19:44:35,266 (http-0.0.0.0-8443-2) [
> ControlServlet.java:141:INFO ] [[[createUpdateShippingAddress] Request
> Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
> 2011-07-16 19:44:35,283 (http-0.0.0.0-8443-2) [
>  ConfigXMLReader.java:120:INFO ] controller loaded: 0.0030s, 281 requests,
> 96 views in jndi:/0.0.0.0/ecomm/traditional/WEB-INF/controller.xml
> 2011-07-16 19:44:35,286 (http-0.0.0.0-8443-2) [
> ServiceEcaRule.java:150:INFO ] Running Service ECA Service:
> setAnonUserLogin, triggered by rule on Service:
> createUpdateCustomerAndShippingAddress
> 2011-07-16 19:44:35,392 (http-0.0.0.0-8443-2) [
>  ServiceDispatcher.java:599:INFO ] Sync service
> [traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
> response [{responseMessage=success}]
> 2011-07-16 19:44:35,396 (http-0.0.0.0-8443-2) [
>  TransactionUtil.java:374:WARN ]
>  exception report
> --
> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
> stack trace shows where this is happening:
> Exception: java.lang.Exception
> Message: Error in simple-method [Create/Update Customer, Shipping Address
> and other contact details.
> [file:/home/jsoto/workspace/ofbizcustom/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml#createUpdateCustomerAndShippingAddress]]:
> ; {Area code is missing, Falta Teléfono de Contacto}
>  stack trace
> ---
> java.lang.Exception: Error in simple-method [Create/Update Customer,
> Shipping Address and other contact details.
> [file:/home/jsoto/workspace/ofbizcustom/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml#createUpdateCustomerAndShippingAddress]]:
> ; {Area code is missing, Falta Teléfono de Contacto}
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:374)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:316)
> org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:870)
> org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:160)
> org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:142)
> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.java:78)
> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:53)
> org.ofbiz.service.ModelServiceReader$GenericInvokerImpl.runSync(ModelServiceReader.java:761)
> _$gen.file_58$.home.jsoto.workspace.ofbizcustom.applications.order.servicedef.services_95$checkout_46$xml_35$createUpdateCustomerAndShippingAddress.runSync(file:/home/jsoto/workspace/ofbizcustom/applications/order/servicedef/services_checkout.xml#createUpdateCustomerAndShippingAddress:24)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:399)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:226)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:165)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:336)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:638)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:384)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:224)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:87)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:338)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1

Issue with ajax and json response

2011-07-16 Thread Jonatan Soto
Hi all,

I am customizing the onePageCheckout (the anonymous part) and I found
something strange. I've changed the client-side validation in order to allow
the customer to only introduce the phone, cell phone or both. But on
server-side I didn't change anything in the PartyContactMechMapProcs.xml
yet. So, it is throwing an error of course, but the ajax handler does not
consider it as an error. It always executes the success ajax handler!

This is the stack trace:

2011-07-16 19:44:35,266 (http-0.0.0.0-8443-2) [
ControlServlet.java:141:INFO ] [[[createUpdateShippingAddress] Request
Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2011-07-16 19:44:35,283 (http-0.0.0.0-8443-2) [
 ConfigXMLReader.java:120:INFO ] controller loaded: 0.0030s, 281 requests,
96 views in jndi:/0.0.0.0/ecomm/traditional/WEB-INF/controller.xml
2011-07-16 19:44:35,286 (http-0.0.0.0-8443-2) [
ServiceEcaRule.java:150:INFO ] Running Service ECA Service:
setAnonUserLogin, triggered by rule on Service:
createUpdateCustomerAndShippingAddress
2011-07-16 19:44:35,392 (http-0.0.0.0-8443-2) [
 ServiceDispatcher.java:599:INFO ] Sync service
[traditional#JF/setAnonUserLogin] finished in [105] milliseconds with
response [{responseMessage=success}]
2011-07-16 19:44:35,396 (http-0.0.0.0-8443-2) [
 TransactionUtil.java:374:WARN ]
 exception report
--
[TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
stack trace shows where this is happening:
Exception: java.lang.Exception
Message: Error in simple-method [Create/Update Customer, Shipping Address
and other contact details.
[file:/home/jsoto/workspace/ofbizcustom/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml#createUpdateCustomerAndShippingAddress]]:
; {Area code is missing, Falta Teléfono de Contacto}
 stack trace
---
java.lang.Exception: Error in simple-method [Create/Update Customer,
Shipping Address and other contact details.
[file:/home/jsoto/workspace/ofbizcustom/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml#createUpdateCustomerAndShippingAddress]]:
; {Area code is missing, Falta Teléfono de Contacto}
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:374)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:316)
org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:870)
org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:160)
org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:142)
org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.java:78)
org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:53)
org.ofbiz.service.ModelServiceReader$GenericInvokerImpl.runSync(ModelServiceReader.java:761)
_$gen.file_58$.home.jsoto.workspace.ofbizcustom.applications.order.servicedef.services_95$checkout_46$xml_35$createUpdateCustomerAndShippingAddress.runSync(file:/home/jsoto/workspace/ofbizcustom/applications/order/servicedef/services_checkout.xml#createUpdateCustomerAndShippingAddress:24)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:399)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:226)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:165)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:336)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:638)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:384)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:224)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:87)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:338)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11Con