You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by jayakumar t <me...@gmail.com> on 2009/02/27 12:52:30 UTC
Using Ajax in Ofbiz
Hi All,
I am having a problem with Ajax in Ofbiz .In Ofbiz ajax request Send by
using
new Ajax.Request("productService",........etc
but it is not calling my jsonservice "productService".
Is there any need to include any other JS files in my ftl?
regards
Jayakumar T
RE: Using Ajax in Ofbiz
Posted by "Sanders, Brian" <BS...@connextions.com>.
I use a SOAP client based on jQuery. I can't really say how good/bad it is, but I tried to use another client first which was a PITA and I never got it working. I then tried this and found it easy to use. You can get it from http://plugins.jquery.com/project/jqSOAPClient
-----Original Message-----
From: Ján Valkovič [mailto:yanick@samsonzv.sk]
Sent: Friday, February 27, 2009 8:25 AM
To: user@ofbiz.apache.org
Subject: Re: Using Ajax in Ofbiz
Hi,
try DWR ( http://directwebremoting.org/ ). You will need create service broker in java, like this (code sample):
@RemoteMethod
public Map callOfbizService(String serviceName, Map serviceContext) {
WebContext ctx = WebContextFactory.get();
try {
HttpServletRequest request = ctx.getHttpServletRequest();
GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
LocalDispatcher dispatcher = (GenericValue) request.getSession().getAttribute("dispatcher");
// some code
serviceContext.put("userLogin", userLogin);
Map resultFromRequestedService = dispatcher.runSync(serviceName, serviceContext);
// some other code 1
{ catch(Exception e) {
// catch action
}
// some other code 2
return resultFromRequestedService;
{
Hope this helps
ya
Dňa Pi, 2009-02-27 o 17:22 +0530, jayakumar t napísal:
> Hi All,
>
> I am having a problem with Ajax in Ofbiz .In Ofbiz ajax request Send by
> using
>
> new Ajax.Request("productService",........etc
>
> but it is not calling my jsonservice "productService".
>
> Is there any need to include any other JS files in my ftl?
>
>
> regards
>
> Jayakumar T
Re: Using Ajax in Ofbiz
Posted by Ján Valkovič <ya...@samsonzv.sk>.
Hi,
try DWR ( http://directwebremoting.org/ ). You will need create service broker in java, like this (code sample):
@RemoteMethod
public Map callOfbizService(String serviceName, Map serviceContext) {
WebContext ctx = WebContextFactory.get();
try {
HttpServletRequest request = ctx.getHttpServletRequest();
GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
LocalDispatcher dispatcher = (GenericValue) request.getSession().getAttribute("dispatcher");
// some code
serviceContext.put("userLogin", userLogin);
Map resultFromRequestedService = dispatcher.runSync(serviceName, serviceContext);
// some other code 1
{ catch(Exception e) {
// catch action
}
// some other code 2
return resultFromRequestedService;
{
Hope this helps
ya
Dňa Pi, 2009-02-27 o 17:22 +0530, jayakumar t napísal:
> Hi All,
>
> I am having a problem with Ajax in Ofbiz .In Ofbiz ajax request Send by
> using
>
> new Ajax.Request("productService",........etc
>
> but it is not calling my jsonservice "productService".
>
> Is there any need to include any other JS files in my ftl?
>
>
> regards
>
> Jayakumar T
Re: Using Ajax in Ofbiz
Posted by BJ Freeman <bj...@free-man.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
also ofbiz, does not use object or classes, perse
that said with java 1.5 objects are defined in the java portion of the
code. and Java Class is used.
jayakumar t sent the following on 2/27/2009 5:08 AM:
> Hi Pranay Pandey,
>
> I wand to know, Where is this "AJAX" object in ofbiz?. Then only my script
> identify that.
>
>
> regards
>
> Jayakumar T
>
> On Fri, Feb 27, 2009 at 5:34 PM, Pranay Pandey <
> pranay.pandey@hotwaxmedia.com> wrote:
>
>> Hello Jaykumar,
>>
>> The pattern for calling Ajax request can traced out well by looking at
>> "OnePageCheckout" from applications/ecommerce/widget/OrderScreens.xml.
>> You can understand it well by tracing out the code and running it in
>> ecommerce application or for more help please provide the steps you are
>> performing for calling Ajax request.
>>
>> Thanks & Regards
>> --
>> Pranay Pandey
>>
>>
>>
>> On Feb 27, 2009, at 5:22 PM, jayakumar t wrote:
>>
>> Hi All,
>>> I am having a problem with Ajax in Ofbiz .In Ofbiz ajax request Send by
>>> using
>>>
>>> new Ajax.Request("productService",........etc
>>>
>>> but it is not calling my jsonservice "productService".
>>>
>>> Is there any need to include any other JS files in my ftl?
>>>
>>>
>>> regards
>>>
>>> Jayakumar T
>>>
>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJqDkUrP3NbaWWqE4RAuRqAJ96xBCF7BL3ktAX1OdffBXpcCbtYgCbBf1a
IPuoUYuyncAwCDCp9Q9koSU=
=ogXS
-----END PGP SIGNATURE-----
Re: Using Ajax in Ofbiz
Posted by jayakumar t <me...@gmail.com>.
Hi Pranay Pandey,
I wand to know, Where is this "AJAX" object in ofbiz?. Then only my script
identify that.
regards
Jayakumar T
On Fri, Feb 27, 2009 at 5:34 PM, Pranay Pandey <
pranay.pandey@hotwaxmedia.com> wrote:
> Hello Jaykumar,
>
> The pattern for calling Ajax request can traced out well by looking at
> "OnePageCheckout" from applications/ecommerce/widget/OrderScreens.xml.
> You can understand it well by tracing out the code and running it in
> ecommerce application or for more help please provide the steps you are
> performing for calling Ajax request.
>
> Thanks & Regards
> --
> Pranay Pandey
>
>
>
> On Feb 27, 2009, at 5:22 PM, jayakumar t wrote:
>
> Hi All,
>>
>> I am having a problem with Ajax in Ofbiz .In Ofbiz ajax request Send by
>> using
>>
>> new Ajax.Request("productService",........etc
>>
>> but it is not calling my jsonservice "productService".
>>
>> Is there any need to include any other JS files in my ftl?
>>
>>
>> regards
>>
>> Jayakumar T
>>
>
>
Re: Using Ajax in Ofbiz
Posted by Pranay Pandey <pr...@hotwaxmedia.com>.
Hello Jaykumar,
The pattern for calling Ajax request can traced out well by looking at
"OnePageCheckout" from applications/ecommerce/widget/OrderScreens.xml.
You can understand it well by tracing out the code and running it in
ecommerce application or for more help please provide the steps you
are performing for calling Ajax request.
Thanks & Regards
--
Pranay Pandey
On Feb 27, 2009, at 5:22 PM, jayakumar t wrote:
> Hi All,
>
> I am having a problem with Ajax in Ofbiz .In Ofbiz ajax request Send
> by
> using
>
> new Ajax.Request("productService",........etc
>
> but it is not calling my jsonservice "productService".
>
> Is there any need to include any other JS files in my ftl?
>
>
> regards
>
> Jayakumar T