You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Peter Henderson <pe...@starjar.com> on 2017/09/14 09:24:07 UTC
Web socket connected event and onConfigure
Hi All,
I have a link on a panel which should only be enabled while there is a
connected web socket.
The link overrides onConfigure and calls setEnabled [1]
When a web socket connected event is received I store the connected message
and add the link to the payload handler. [2]
I expect the handler to trigger a call on link.onConfigure (just like an
ajax update) but it is not.
What am I doing wrong.
Quick start (in Java!)
https://github.com/bollinger/WsOnConnect
Many thanks
Peter.
[1]
https://github.com/bollinger/WsOnConnect/blob/ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/mycompany/MyPanel.java#L48
[2]
https://github.com/bollinger/WsOnConnect/blob/ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/mycompany/MyPanel.java#L99
--
Peter Henderson
Re: Web socket connected event and onConfigure
Posted by Peter Henderson <pe...@starjar.com>.
On 14 September 2017 at 10:54, Maxim Solodovnik <so...@gmail.com>
wrote:
> I'm afraid you cannot update page on websocket connected
> You need to workaround this
>
> Here is what we are are using:
> Java: handling of special `connected` message:
> https://github.com/apache/openmeetings/blob/master/
> openmeetings-web/src/main/java/org/apache/openmeetings/
> web/common/MainPanel.java#L235
> JS: send `connected` message
> https://github.com/apache/openmeetings/blob/master/
> openmeetings-web/src/main/java/org/apache/openmeetings/
> web/common/MainPanel.html#L40
>
> works as expected
>
Brilliant.
Thanks
>
>
> On Thu, Sep 14, 2017 at 4:24 PM, Peter Henderson
> <pe...@starjar.com> wrote:
> > Hi All,
> >
> > I have a link on a panel which should only be enabled while there is a
> > connected web socket.
> >
> > The link overrides onConfigure and calls setEnabled [1]
> >
> > When a web socket connected event is received I store the connected
> message
> > and add the link to the payload handler. [2]
> > I expect the handler to trigger a call on link.onConfigure (just like an
> > ajax update) but it is not.
> >
> > What am I doing wrong.
> >
> > Quick start (in Java!)
> > https://github.com/bollinger/WsOnConnect
> >
> > Many thanks
> > Peter.
> >
> >
> > [1]
> > https://github.com/bollinger/WsOnConnect/blob/
> ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/
> mycompany/MyPanel.java#L48
> >
> > [2]
> > https://github.com/bollinger/WsOnConnect/blob/
> ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/
> mycompany/MyPanel.java#L99
> >
> > --
> > Peter Henderson
>
>
>
> --
> WBR
> Maxim aka solomax
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Peter Henderson
Re: Web socket connected event and onConfigure
Posted by Maxim Solodovnik <so...@gmail.com>.
I'm afraid you cannot update page on websocket connected
You need to workaround this
Here is what we are are using:
Java: handling of special `connected` message:
https://github.com/apache/openmeetings/blob/master/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.java#L235
JS: send `connected` message
https://github.com/apache/openmeetings/blob/master/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.html#L40
works as expected
On Thu, Sep 14, 2017 at 4:24 PM, Peter Henderson
<pe...@starjar.com> wrote:
> Hi All,
>
> I have a link on a panel which should only be enabled while there is a
> connected web socket.
>
> The link overrides onConfigure and calls setEnabled [1]
>
> When a web socket connected event is received I store the connected message
> and add the link to the payload handler. [2]
> I expect the handler to trigger a call on link.onConfigure (just like an
> ajax update) but it is not.
>
> What am I doing wrong.
>
> Quick start (in Java!)
> https://github.com/bollinger/WsOnConnect
>
> Many thanks
> Peter.
>
>
> [1]
> https://github.com/bollinger/WsOnConnect/blob/ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/mycompany/MyPanel.java#L48
>
> [2]
> https://github.com/bollinger/WsOnConnect/blob/ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/mycompany/MyPanel.java#L99
>
> --
> Peter Henderson
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org