On Thu, Feb 21, 2019 at 11:40 AM Matteo Alessandroni <skylar...@apache.org> wrote:
> Hi, > > thanks for the answer! > There are no js errors and browser devtool does not show any WS request > so I'm not sure it's passing the correct body. > When the WebSocket connection is established (maybe when the page is loaded) you should see an entry in the Network tab. If you select this entry then on the right-side you should see any WS messages to/from the server. > Anyway, if I add: > > resourceCreateEvent.getTarget().appendJavaScript(String.format("addEndpoint('%s', > > '%s', '%s');", > resourceCreateEvent.getParent(), > resourceCreateEvent.getKey(), > resourceCreateEvent.getKind())); > > directly here [1], instead of calling "window.Wicket.WebSocket.send(..." > it works and the "addEndpoint(...)" method is called. > The main difference seems to be that the "appendJavaScript()" is called > on "resourceCreateEvent.getTarget()" instead of on a WebSocketBehavior > object. > What is the type of resourceCreateEvent.getTarget() ? Is it WebSocketRequestHandler or AjaxRequestHandler ? > > [1] > > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java#L602-L609 > > > On 21/02/19 10:01, Martin Grigorov wrote: > > Hi, > > > > Check the browser's Dev Tools' console for any JavaScript errors. > > If there are no errors then check in the DevTools Network tab whether the > > WebSocket response frame contains the JS code in its body. It must be > > inside <execution> XML element. If it is not there at all then it must be > > something on the server side. > > > > On Thu, Feb 21, 2019 at 10:54 AM Matteo Alessandroni < > skylar...@apache.org> > > wrote: > > > >> Hi, > >> > >> we have a logic where a websocket message is sent from an "onEvent()" > >> method [1] and catched in a WebSocketBehavior class [2]. > >> Then, a call to a js method "addEndpoint()"[3] must be executed. > >> Our problem is that the js code "addEndpoint(...)" inside > >> "handler.appendJavaScript(...)" [4] is not executed, so the code > >> correctly reaches that switch case but it's like the > >> "appendJavaScript(...)" is not working. > >> > >> On our application v2.0.x that code works and it uses Wicket 7.x, while > >> the newer v2.1.x uses Wicket 8.x and it does not work. > >> > >> Could you please give us an hint of this? Is there anything we are > >> missing to make it work for Wicket 8.x? > >> > >> Thank you! > >> > >> > >> [1] > >> > >> > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java#L602-L609 > >> [2] > >> > >> > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java#L153-L157 > >> [3] > >> > >> > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/resources/META-INF/resources/js/topology.js#L269-L280 > >> [4] > >> > >> > https://github.com/apache/syncope/blob/2_1_X/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java#L154 > >> > >> -- > >> > >> Dott. Matteo Alessandroni > >> > >> Software Engineer @ Tirasa S.r.l. > >> > >> Viale Vittoria Colonna, 97 - 65127 Pescara > >> Tel +39 0859116307 / FAX +39 0859111173 > >> > >> http://www.tirasa.net > >> > >> Apache Syncope PMC Member > >> http://people.apache.org/phonebook.html?uid=skylark17 > >> <http://people.apache.org/phonebook.html?uid=skylark17> > >> > >> Tirasa S.r.l. <http://www.tirasa.net> > >> > > -- > > Dott. Matteo Alessandroni > > Software Engineer @ Tirasa S.r.l. > > Viale Vittoria Colonna, 97 - 65127 Pescara > Tel +39 0859116307 / FAX +39 0859111173 > > http://www.tirasa.net > > Apache Syncope PMC Member > http://people.apache.org/phonebook.html?uid=skylark17 > <http://people.apache.org/phonebook.html?uid=skylark17> > > Tirasa S.r.l. <http://www.tirasa.net> >