no body there ...
Steve Sobol - 18 Jan 2006 14:38 GMT
> no body there ...
Sorry, it was late and I had to sleep. Try being patient next time you ask
a question on Usenet - you won't necessarily get an immediate answer.

Signature
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307
>>> use "." operator to access the class methods......so, whats the worth
>>> of it ?
[quoted text clipped - 4 lines]
>
> yes. i am reading the documentation.
FYI, http://getahead.ltd.uk/dwr/documentation is where I am, not the page at
dwr.dev.java.net - the uk address is the main project website.
http://getahead.ltd.uk/dwr/server/dwrxml talks about web.xml
http://getahead.ltd.uk/dwr/server/dwrxml/creators is the first thing you
need to look at. I have both a creator and a converter:
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="Demo">
<param name="class" value="com.yourwebmail.Addit"/>
</create>
<convert converter="bean" match="com.yourwebmail.Addit"/>
</allow>
</dwr>
I don't use BeanShell or Spring, so I'm creating the bean using the
creator="new" attribute in the create tag. It's exposed to my Javascript as
an object named Demo.
The creator can specify which methods are exposed to Javascript.
Then the converter tag uses the Bean converter,
http://getahead.ltd.uk/dwr/server/dwrxml/converters/bean
to actually convert my JavaBean into something usable by Javascript.
My Addit class is
package com.yourwebmail;
public class Addit {
public int add3(int i) {
return(i+3);
}
}
and I call it this way:
<script type="text/javascript"
src="http://YOUR_HOSTNAME_HERE/dwr/interface/Remote.js"> </script>
<script type="text/javascript"
src="http://YOUR_HOSTNAME_HERE/dwr/engine.js"> </script>
<script>
function handleGetData(str)
{
alert(str);
}
Demo.add3(42, handleGetData);
</script>
This calls my class's add3 method, passes in 42 and will pop up an alert box
displaying 45.
Hopefully this is clearer to you having seen all of the pieces in one place
but again, I strongly suggest that you look at the samples.
> QUESTION 1 :
>
> does it convert the "[your.package].Message" class into a javascript
> variable ? whats the name of that variable ? is that name "bean" ?
The Javascript variable is whatever you specify in the javascript attribute
of the <creator> tag. Mine is "Demo"
> QUESTION 2:
>
> the docs says, the convertor converts the POJO into javascript object
>
> How do you access that object in javascript now ? because, in java we
> acces a method
See above.
> if that POJO is now converted into javascript object , how do i access
> methods now ?
Don't think "converted" - think "exposed to JavaScript". On the backend, DWR
will still make a method call to your POJO.
> QUESTION 3:
> do you use <convertor tag in your dwr.xml ?
Yes.

Signature
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307
gk - 19 Jan 2006 05:21 GMT
you have this code
public class Addit {
public int add3(int i) {
return(i+3);
}
Demo.add3(42, handleGetData);
Question 1:
===========
will you please tell
Demo.add3(42, handleGetData);
AND
Demo.add3(handleGetData,42);
are same?
//Note the order.
> >>> use "." operator to access the class methods......so, whats the worth
> >>> of it ?
[quoted text clipped - 100 lines]
> Personal blog, resume, portfolio: http://SteveSobol.com/
> E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307
Steve Sobol - 20 Jan 2006 05:39 GMT
> Demo.add3(42, handleGetData);
>
[quoted text clipped - 3 lines]
>
> are same?
Ummmm, if I remember correctly, you can put the callback function before the
arguments or after, but it's suggested that the callback function be listed
last. But you'll want to check the DWR website to be sure.

Signature
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307
gk - 20 Jan 2006 06:41 GMT
thank you very much.
you helped me a lot.
great man.
regards
> > Demo.add3(42, handleGetData);
> >
[quoted text clipped - 13 lines]
> Personal blog, resume, portfolio: http://SteveSobol.com/
> E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307
Steve Sobol - 20 Jan 2006 07:02 GMT
> thank you very much.
Don't mention it. I just happen to be doing my first DWR project, and I've
completed a couple successful tests, and I'm happy to be able to help.
For the rest of you that aren't familiar with Direct Web Remoting - it's an
interesting (and, I believe, quite useful) project.
http://getahead.ltd.uk/dwr
http://dwr.dev.java.net/

Signature
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307