You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Deepak Agarwal <da...@gmail.com> on 2013/03/05 10:00:17 UTC

How to get response in json for autocomplete

Current autocomplete is returning a html. How can I get it as json.

-- 
Thanks,
Deepak Agarwal,

Mobile: +91 9501190044

Re: How to get response in json for autocomplete

Posted by Adrian Crum <ad...@sandglass-software.com>.
You should be able to do conversions in OFBiz using the converter framework.

-Adrian

On 3/6/2013 8:04 AM, Mandeep Sidhu wrote:
> Invoke a java event instead of a service, set the view to none and render
> the response as json, you can break down regular java objects into json
> using codeheues jackson library.
>
>
> On Tue, Mar 5, 2013 at 1:23 AM, Deepak Agarwal <da...@gmail.com> wrote:
>
>> Well I am not sure if this is the best way to do but I achieved by adding a
>> new ftl ajaxAutocompleteOptionsJson.ftl (in place
>> of ajaxAutocompleteOptions.ftl ) , modified it to return just the data and
>> set the content-type="application/json" in my controller.xml view-map
>>
>> On Tue, Mar 5, 2013 at 2:30 PM, Deepak Agarwal <da...@gmail.com>
>> wrote:
>>
>>> Current autocomplete is returning a html. How can I get it as json.
>>>
>>> --
>>> Thanks,
>>> Deepak Agarwal,
>>>
>>> Mobile: +91 9501190044
>>
>>
>>
>> --
>> Thanks,
>> Deepak Agarwal,
>>
>> Mobile: +91 9501190044
>>
>
>


Re: How to get response in json for autocomplete

Posted by Mandeep Sidhu <ma...@gmail.com>.
Invoke a java event instead of a service, set the view to none and render
the response as json, you can break down regular java objects into json
using codeheues jackson library.


On Tue, Mar 5, 2013 at 1:23 AM, Deepak Agarwal <da...@gmail.com> wrote:

> Well I am not sure if this is the best way to do but I achieved by adding a
> new ftl ajaxAutocompleteOptionsJson.ftl (in place
> of ajaxAutocompleteOptions.ftl ) , modified it to return just the data and
> set the content-type="application/json" in my controller.xml view-map
>
> On Tue, Mar 5, 2013 at 2:30 PM, Deepak Agarwal <da...@gmail.com>
> wrote:
>
> > Current autocomplete is returning a html. How can I get it as json.
> >
> > --
> > Thanks,
> > Deepak Agarwal,
> >
> > Mobile: +91 9501190044
>
>
>
>
> --
> Thanks,
> Deepak Agarwal,
>
> Mobile: +91 9501190044
>



-- 
Regards,
Mandeep Singh Sidhu
http://www.simbacart.com (ofbiz based)
http://www.sidsol.com

Re: How to get response in json for autocomplete

Posted by Deepak Agarwal <da...@gmail.com>.
Well I am not sure if this is the best way to do but I achieved by adding a
new ftl ajaxAutocompleteOptionsJson.ftl (in place
of ajaxAutocompleteOptions.ftl ) , modified it to return just the data and
set the content-type="application/json" in my controller.xml view-map

On Tue, Mar 5, 2013 at 2:30 PM, Deepak Agarwal <da...@gmail.com> wrote:

> Current autocomplete is returning a html. How can I get it as json.
>
> --
> Thanks,
> Deepak Agarwal,
>
> Mobile: +91 9501190044




-- 
Thanks,
Deepak Agarwal,

Mobile: +91 9501190044