Re: WebSocket for tapestry

2014-06-19 Thread Lance Java
Ok, thanks for reporting, I've raised an issue here https://github.com/uklance/tapestry-atmosphere/issues/22

Re: WebSocket for tapestry

2014-06-18 Thread Bogdan Ivascu
1. No errors in JavaScript 2. I'm using 5.3.6 3. I did, all work ok and do not lose their ability to do ajax calls. The problem is as you guessed it. I changed the javascript like so and it works perfectly: tapestry-atmosphere.js ... if (pushTarget.update == 'PREPEND') { var i

Re: WebSocket for tapestry

2014-06-17 Thread Lance Java
I'm starting to think this is caused by the js prepend function. It's simply: element.innerHTML = newHtml + element.innerHTML. I think this function needs to be smarter and do a dom based element addition rather than a String addition. I tried to avoid using prototype or jquery so it was agnos

Re: WebSocket for tapestry

2014-06-17 Thread Lance Java
Hmm. Interesting. 1. Are there any javascript errors in the console? 2. Which version of Tapestry are you using? 3. Try adding an ajax eventlink to the page that's not in a PushTarget (normal page render). Is it affected in the same way? 4. Is the markup for the link in 3 any different from the Pu

Re: WebSocket for tapestry

2014-06-16 Thread Bogdan Ivascu
That did it. Sorry to keep hitting this nail but, I stumbled across another one. As described above, the push targets will "prepend" a block on every update. Inside this bock, I have eventLinks that are rendered correctly after I put in the configuration. These eventLinks are supposed to be ajax. T

Re: WebSocket for tapestry

2014-06-16 Thread Lance Java
See the "configuration" section here https://github.com/uklance/tapestry-offline On 16 Jun 2014 05:44, "Bogdan Ivascu" wrote: > Makes sense, thanks for the reply. > > Another thing that is odd. I seem to have trouble while rendering > eventLinks inside a block that is a delagate of a pushTarget.

Re: WebSocket for tapestry

2014-06-15 Thread Bogdan Ivascu
Makes sense, thanks for the reply. Another thing that is odd. I seem to have trouble while rendering eventLinks inside a block that is a delagate of a pushTarget. in tml: a bunch of html markup in the java class public Block getTokenPlayHistoryBlock(){ switch based on conditions

Re: WebSocket for tapestry

2014-06-15 Thread Lance Java
The disconnect event is fired by atmosphere under the hood (AtmosphereResourceEventListener.onDisconnect). Further reading here: https://github.com/Atmosphere/atmosphere/wiki/onDisconnect-tricks http://atmosphere.github.io/atmosphere/apidocs/org/atmosphere/cpr/AtmosphereResourceEventListener.html

Re: WebSocket for tapestry

2014-06-14 Thread Bogdan Ivascu
Sorry, not that I read it, I should have been more specific. I do see the contribution of the ChatTopicListener in AppModule and the "onConnect" method gets called as expected when any push target creates a new AtmosphereResource. The one that I don't see called is the "onDisconnect" method. On S

Re: WebSocket for tapestry

2014-06-14 Thread Bogdan Ivascu
Hi Lance, What is the way to listen for someone connecting and disconnecting from a topic? I see that you have "TopicListenerImpl" and "ChatTopicListenerImpl" having methods that listen for this type of thing. I don't see how they are used though. Thanks, Bogdan. On Wed, May 21, 2014 at 3:33 A

Re: WebSocket for tapestry

2014-06-02 Thread Thiago H de Paula Figueiredo
The bug that caused the stack trace below was fixed in Tapestry 5.4, but not released yet. I don't know how a null value on onPassivate() could be related. Tapestry does handle null activation context values without any problems. On Fri, 30 May 2014 16:58:25 -0300, Bogdan Ivascu wrote:

Re: WebSocket for tapestry

2014-05-30 Thread Bogdan Ivascu
If anyone else is reading this, how I worked around this issue. The page in question had an "activate" method that took two parameters. Depending on page context, it's sister "passivate" method would sometimes return null for one of the array parameters. I made sure this never happened by checking

Re: WebSocket for tapestry

2014-05-28 Thread Thiago H de Paula Figueiredo
That's an unrelated but known issue. On Wed, 28 May 2014 17:42:19 -0300, Bogdan Ivascu wrote: An interesting issue with the atmos library. I put the webSocket code in my Layout component and there are no issues when I navigate about between pages that wrap themselves in this layout. I do

Re: WebSocket for tapestry

2014-05-28 Thread Bogdan Ivascu
An interesting issue with the atmos library. I put the webSocket code in my Layout component and there are no issues when I navigate about between pages that wrap themselves in this layout. I do encounter a NullPointer when this Layout contains another Layout and then the page. To be more clear: Ma

Re: WebSocket for tapestry

2014-05-28 Thread Bogdan Ivascu
Thank you for the reply Lance. This was a very literal "couple of lines of javascript". The solution you posted on Git works and the T5 Initilizers are being called as expected. On Wed, May 21, 2014 at 3:33 AM, Lance Java wrote: > I've implemented this feature in tapestry-cometd but it's not bee

Re: WebSocket for tapestry

2014-05-21 Thread Lance Java
I've implemented this feature in tapestry-cometd but it's not been implemented in tapestry-atmosphere yet. I think it's only a couple of lines of javascript. I have just updated the outstanding issue with a possible solution here: https://github.com/uklance/tapestry-atmosphere/issues/5 Pull reque

Re: WebSocket for tapestry

2014-05-20 Thread Bogdan Ivascu
I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/

Re: WebSocket for tapestry

2014-05-14 Thread Lance Java
If you just want Tapestry to manage an existing servlet, you can copy the technique used by AtmosphereHttpServletRequestFilter. Make sure you set the async flag on the tapestry filter app org.apache.tapestry5.TapestryFilter true On 14 May 2014 04:22, "Bogdan Ivas

Re: WebSocket for tapestry

2014-05-13 Thread Lance Java
In it's current state, it won't work with jquery as there's a tiny dependency on prototype's json support. There's possibly two lines of javascript that need to switch to jquery's json support. https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/resources/org/la

Re: WebSocket for tapestry

2014-05-13 Thread Bogdan Ivascu
Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, B

Re: WebSocket for tapestry

2014-05-13 Thread Lance Java
In particular, you'll be interested in the usage of HttpServletHttpServletRequestFilter. https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/internal/HttpServletHttpServletRequestFilter.java https://github.com/uklance/tapest

Re: WebSocket for tapestry

2014-05-13 Thread Michael Dukaczewski
Is tapestry-atmosphere compatible with Tapestry 5.4? Am 13.05.14 10:27, schrieb Lance Java: In particular, you'll be interested in the usage of HttpServletHttpServletRequestFilter. https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosp

Re: WebSocket for tapestry

2014-05-13 Thread Lance Java
Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, "Bogdan Ivascu" wrote: > Hi everyone, > I want to add webSocket support for my tapestry project and need a few