Re: DWR with T5

2009-02-27 Thread Stephane Decleire
I've integrated DWR in my application and even in several libraries.
The simplest way seems to use Spring as the glue ...
So you can use Spring as the creator.

Stephane

kace a écrit :
 Hi fellas, 

 I am looking to integrate Tapestry 5 with DWR 3-RC1.  

 Added the following to web.xml

 servlet
 servlet-namedwr-invoker/servlet-name

 servlet-classorg.directwebremoting.servlet.DwrServlet/servlet-class
 init-param
 param-nameactiveReverseAjaxEnabled/param-name
 param-valuetrue/param-value
 /init-param
 init-param
 param-namedebug/param-name
 param-valuetrue/param-value
 /init-param
 init-param
 param-namemaxWaitAfterWrite/param-name
 param-value-1/param-value
 /init-param
 load-on-startup1/load-on-startup
 /servlet

 servlet-mapping
 servlet-namedwr-invoker/servlet-name
 url-pattern/dwr/*/url-pattern
 /servlet-mapping

 added the following to the module class:

 public static void contributeIgnoredPathsFilter(ConfigurationString
 configuration) {
 configuration.add(/dwr/.*);
 }

 Now, Im trying to run a simple test but not sure how to handle the dwr.xml,
 specifically, what to use as creator? 

 allow
 create creator=? 
 
 /create
 /allow

 Has anyone got a working example with tapestry that can be looked at?

 Appreciate any help.

 Thanks

 ..kace



   


Re: DWR with T5

2009-02-27 Thread kace

What would I have to do differently in order to use Spring as the glue?
-- 
View this message in context: 
http://www.nabble.com/DWR-with-T5-tp22249541p22249913.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: DWR with T5

2009-02-27 Thread kace

Looking to get the javascript files injected for dwr into my page but having
difficulty with the @IncludeJavaScriptLibrary(/dwr/engine.js)

Using that tells it to look for the js files where the page class is but I
am needing it to look at  http://myapp/dwr/engine.js

Thanks, 

..kace
-- 
View this message in context: 
http://www.nabble.com/DWR-with-T5-tp22249541p22251524.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: DWR with T5

2009-02-27 Thread Carl Crowder

Change that to @IncludeJavaScriptLibrariy(context:/dwr/engine.js)

kace wrote:

Looking to get the javascript files injected for dwr into my page but having
difficulty with the @IncludeJavaScriptLibrary(/dwr/engine.js)

Using that tells it to look for the js files where the page class is but I
am needing it to look at  http://myapp/dwr/engine.js

Thanks, 


..kace


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: DWR with T5

2009-02-27 Thread kace

Nope, that doesnt work :(  it takes me to my page class and then starts to
look for the js from that reference point ( I think)

Caused by: java.lang.RuntimeException: Unable to locate asset
'context:dwr/engine.js' (the file does not exist).

Thanks

..kace
-- 
View this message in context: 
http://www.nabble.com/DWR-with-T5-tp22249541p22252067.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: DWR with T5

2009-02-27 Thread kace

I ended up with the following in my page class to get the scripts added:

void setupRender() {

renderSupport.addScriptLink(request.getContextPath()+
/dwr/engine.js);
renderSupport.addScriptLink(request.getContextPath()+
/dwr/util.js);
renderSupport.addScriptLink(request.getContextPath()+
/dwr/interface/myPageName.js);
}

However, I am trying to do a test but I get no response

form t:type = Form t:id = form
   p
Name:
input type = text id=demoName onblur=updates();/
 br/
Reply: 
/p
/form

script type = text/javascript
   
function updates() {
  var name = dwr.util.getValue(demoName);
  myPageName.sayHello(name, function(data) {
dwr.util.setValue(demoReply, data);
  });
}

/script

and I have this in the java class:

public String sayHello(String name) {
System.out.println(Hello,  + name);
return Hello,  + name;
}

The simplest example but I cant get it to work.  Using Tapestry 5.0.18 ;
DWR-3.0-RC1

I get the following error : Error: undefined, Error - Anyone who started
playing with this have this problem early on?

Thanks

.kace

-- 
View this message in context: 
http://www.nabble.com/DWR-with-T5-tp22249541p22254869.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: DWR with T5

2009-02-27 Thread Stephane Decleire
Where is the demoReply tag in your html ?
Have you tried to launch the DWR test tool to check that it works before
integrating it in your pages ?

Stephane

kace a écrit :
 I ended up with the following in my page class to get the scripts added:

 void setupRender() {

 renderSupport.addScriptLink(request.getContextPath()+
 /dwr/engine.js);
 renderSupport.addScriptLink(request.getContextPath()+
 /dwr/util.js);
 renderSupport.addScriptLink(request.getContextPath()+
 /dwr/interface/myPageName.js);
 }

 However, I am trying to do a test but I get no response

 form t:type = Form t:id = form
p
 Name:
 input type = text id=demoName onblur=updates();/
  br/
 Reply: 
 /p
 /form

 script type = text/javascript

 function updates() {
   var name = dwr.util.getValue(demoName);
   myPageName.sayHello(name, function(data) {
 dwr.util.setValue(demoReply, data);
   });
 }

 /script

 and I have this in the java class:

 public String sayHello(String name) {
 System.out.println(Hello,  + name);
 return Hello,  + name;
 }

 The simplest example but I cant get it to work.  Using Tapestry 5.0.18 ;
 DWR-3.0-RC1

 I get the following error : Error: undefined, Error - Anyone who started
 playing with this have this problem early on?

 Thanks

 .kace