You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "deepti.mittal" <de...@paytm.com> on 2011/08/26 07:49:20 UTC

Re: OFbiz with Ajax (DWR)

I want to integrate DWR with Ofbiz. Can anyone help me with that. I tried to
find some tutorial in myofbiz.com also, but couldnt find any.

Regards

--
View this message in context: http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3770066.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: OFbiz with Ajax (DWR)

Posted by Ruth Hoffman <rh...@aesolves.com>.
Hi Deepti:
First thing to try is the DWR testing interface. Can you call your OFBiz 
event through that interface? If so, then there is something wrong with 
your FTL code. If not, then there is something wrong with your back end 
event or the integration/configuration of the same.
Best Regards,
Ruth

On 8/30/11 12:38 AM, deepti.mittal wrote:
> Hi Guys,
>
> Thanks for helping me out in this.
> I tried to implement a basic example of DWR but it is giving some error. Can
> someone help me out with the steps I need to do for implementing the same or
> if I am missing something.
> The steps I followed were:
> 1. Added dwr.jar&  commons-logging.jar in WEB-INF/lib folder
> 2. Added dwr.xml in WEB-INF.xml folder with the following contents:
> <dwr>
>    <allow>
>      <create creator="new" javascript="HelloWorldModelImpl">
>
>      </create>
>    </allow>
> </dwr>
> 3. Now in the ftl file, added thw following code:
>
>
>
> function doLoad()
> {
> 	alert("firing AJAX call");
> 	HelloWorldModelImpl.getTime(callbackAfterLoad);
> }
>
> function callbackAfterLoad(dataFromServer)
> {
> 	alert("return from Ajax call");
> 	alert(dataFromServer);
> }
>
> and finally<body onload="javascript:doLoad();">
>
> The above code displays "firing AJAX call" and the next alert is "Error".
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3777945.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: OFbiz with Ajax (DWR)

Posted by "deepti.mittal" <de...@paytm.com>.
Hi Guys,

Thanks for helping me out in this.
I tried to implement a basic example of DWR but it is giving some error. Can
someone help me out with the steps I need to do for implementing the same or
if I am missing something.
The steps I followed were:
1. Added dwr.jar & commons-logging.jar in WEB-INF/lib folder
2. Added dwr.xml in WEB-INF.xml folder with the following contents:
<dwr>
  <allow>
    <create creator="new" javascript="HelloWorldModelImpl">
      
    </create>
  </allow>
</dwr>
3. Now in the ftl file, added thw following code:



function doLoad()
{
	alert("firing AJAX call");
	HelloWorldModelImpl.getTime(callbackAfterLoad);
}

function callbackAfterLoad(dataFromServer)
{
	alert("return from Ajax call");
	alert(dataFromServer);
}

and finally <body onload="javascript:doLoad();">

The above code displays "firing AJAX call" and the next alert is "Error".

--
View this message in context: http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3777945.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: OFbiz with Ajax (DWR)

Posted by Ruth Hoffman <rh...@aesolves.com>.
Hi Deepti:

I've done this many times. I prefer DWR to other AJAX frameworks 
(including the existing OFBiz JSON inplementation) because it is so easy 
to use. An example of this is on the MyOFBiz.com home page. All the 
testimonials are retrieved using DWR calls to an OFBiz event. 
(http://www.myofbiz.com).

Best to follow the instructions on the DWR site and just use any OFBiz 
Component as the starting point.

Best Regards,
Ruth Hoffman


On 8/26/11 1:49 AM, deepti.mittal wrote:
> I want to integrate DWR with Ofbiz. Can anyone help me with that. I tried to
> find some tutorial in myofbiz.com also, but couldnt find any.
>
> Regards
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3770066.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: OFbiz with Ajax (DWR)

Posted by Ruth Hoffman <rh...@aesolves.com>.
Hi Chatree:
I have not had a chance to look at this. If it had been available when I 
needed AJAX support I probably would have used it.
Thanks for bringing this to my attention.
Best Regards,
Ruth

On 8/28/11 10:13 AM, Chatree Srichart wrote:
> Hi Ruth Hoffman. Have you seen OFBiz-GWT project
> http://code.google.com/p/ofbiz-gwt/ ? You can integrate GWT widgets into
> OFBiz screens. You, in fact, can use any GWT libraries integrate into it. I
> see there is a GWT library for the comet feature called gwt-comet
> http://code.google.com/p/gwt-comet/ . I have not tried it yet but I think it
> should work.
>
> Best Regards,
> Chatree Srichart
>
> On Fri, Aug 26, 2011 at 6:58 PM, Ruth Hoffman<rh...@aesolves.com>  wrote:
>
>> Hi Hans:
>> Not to argue the jQuery point because I use jQuery and love it, but DWR has
>> some really compelling features including the integration of Comet (reverse
>> AJAX).
>>
>> A long time ago (in the 4.x) days I asked about integrating DWR with OFBiz
>> and my request fell on deaf ears. So, I just went ahead and did it myself.
>>
>> Best Regards,
>> Ruth Hoffman
>> http://www.myofbiz.com
>> http://www.aesolves.com
>>
>>
>> On 8/26/11 2:14 AM, Hans Bakker wrote:
>>
>>> First of all make sure it is really required to integrate DWR.
>>> Integration of a tool because you know it is normally not a good reason.
>>> It is normally easier to learn the tool used in OFBiz than to integrate
>>> a new one. OFBiz has standardized on Jquery which we think is one of the
>>> best around.....
>>>
>>> Regards,.
>>> Hans
>>>
>>>
>>> On Thu, 2011-08-25 at 22:49 -0700, deepti.mittal wrote:
>>>
>>>> I want to integrate DWR with Ofbiz. Can anyone help me with that. I tried
>>>> to
>>>> find some tutorial in myofbiz.com also, but couldnt find any.
>>>>
>>>> Regards
>>>>
>>>> --
>>>> View this message in context: http://ofbiz.135035.n4.nabble.**
>>>> com/OFbiz-with-Ajax-DWR-**tp2964923p3770066.html<http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3770066.html>
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>

Re: OFbiz with Ajax (DWR)

Posted by Chatree Srichart <ch...@gmail.com>.
Hi Ruth Hoffman. Have you seen OFBiz-GWT project
http://code.google.com/p/ofbiz-gwt/ ? You can integrate GWT widgets into
OFBiz screens. You, in fact, can use any GWT libraries integrate into it. I
see there is a GWT library for the comet feature called gwt-comet
http://code.google.com/p/gwt-comet/ . I have not tried it yet but I think it
should work.

Best Regards,
Chatree Srichart

On Fri, Aug 26, 2011 at 6:58 PM, Ruth Hoffman <rh...@aesolves.com> wrote:

> Hi Hans:
> Not to argue the jQuery point because I use jQuery and love it, but DWR has
> some really compelling features including the integration of Comet (reverse
> AJAX).
>
> A long time ago (in the 4.x) days I asked about integrating DWR with OFBiz
> and my request fell on deaf ears. So, I just went ahead and did it myself.
>
> Best Regards,
> Ruth Hoffman
> http://www.myofbiz.com
> http://www.aesolves.com
>
>
> On 8/26/11 2:14 AM, Hans Bakker wrote:
>
>> First of all make sure it is really required to integrate DWR.
>> Integration of a tool because you know it is normally not a good reason.
>> It is normally easier to learn the tool used in OFBiz than to integrate
>> a new one. OFBiz has standardized on Jquery which we think is one of the
>> best around.....
>>
>> Regards,.
>> Hans
>>
>>
>> On Thu, 2011-08-25 at 22:49 -0700, deepti.mittal wrote:
>>
>>> I want to integrate DWR with Ofbiz. Can anyone help me with that. I tried
>>> to
>>> find some tutorial in myofbiz.com also, but couldnt find any.
>>>
>>> Regards
>>>
>>> --
>>> View this message in context: http://ofbiz.135035.n4.nabble.**
>>> com/OFbiz-with-Ajax-DWR-**tp2964923p3770066.html<http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3770066.html>
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>

Re: OFbiz with Ajax (DWR)

Posted by Ruth Hoffman <rh...@aesolves.com>.
Hi Hans:
Not to argue the jQuery point because I use jQuery and love it, but DWR 
has some really compelling features including the integration of Comet 
(reverse AJAX).

A long time ago (in the 4.x) days I asked about integrating DWR with 
OFBiz and my request fell on deaf ears. So, I just went ahead and did it 
myself.

Best Regards,
Ruth Hoffman
http://www.myofbiz.com
http://www.aesolves.com

On 8/26/11 2:14 AM, Hans Bakker wrote:
> First of all make sure it is really required to integrate DWR.
> Integration of a tool because you know it is normally not a good reason.
> It is normally easier to learn the tool used in OFBiz than to integrate
> a new one. OFBiz has standardized on Jquery which we think is one of the
> best around.....
>
> Regards,.
> Hans
>
>
> On Thu, 2011-08-25 at 22:49 -0700, deepti.mittal wrote:
>> I want to integrate DWR with Ofbiz. Can anyone help me with that. I tried to
>> find some tutorial in myofbiz.com also, but couldnt find any.
>>
>> Regards
>>
>> --
>> View this message in context: http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3770066.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: OFbiz with Ajax (DWR)

Posted by Hans Bakker <ma...@antwebsystems.com>.
First of all make sure it is really required to integrate DWR.
Integration of a tool because you know it is normally not a good reason.
It is normally easier to learn the tool used in OFBiz than to integrate
a new one. OFBiz has standardized on Jquery which we think is one of the
best around.....

Regards,.
Hans


On Thu, 2011-08-25 at 22:49 -0700, deepti.mittal wrote:
> I want to integrate DWR with Ofbiz. Can anyone help me with that. I tried to
> find some tutorial in myofbiz.com also, but couldnt find any.
> 
> Regards
> 
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/OFbiz-with-Ajax-DWR-tp2964923p3770066.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.

-- 
Ofbiz on twitter: http://twitter.com/apache_ofbiz
Myself on twitter: http://twitter.com/hansbak
Antwebsystems.com: Quality services for competitive rates.