[ 
https://issues.apache.org/jira/browse/WICKET-6232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Grigorov updated WICKET-6232:
------------------------------------
    Fix Version/s: 6.25.0

> When sending binary data from server to client, wicket-websocket-jquery.js 
> throws error "message.indexOf is not a function"
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-6232
>                 URL: https://issues.apache.org/jira/browse/WICKET-6232
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-native-websocket
>    Affects Versions: 7.4.0
>            Reporter: C Quarters
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 8.0.0-M2, 6.25.0, 7.5.0
>
>
> On the server I'm calling this method
> org.apache.wicket.protocol.ws.api.IWebSocketConnection.sendMessage(byte[] 
> message, int offset, int length)
> The Wicket javascript client code (wicket-websocket-jquery.js) assumes the 
> incoming message is a string and attempts to detect if it's an ajax response.
> self.ws.onmessage = function (event) {
>   var message = event.data;
>   if (message && message.indexOf('<ajax-response>') > -1) {
>     var call = new Wicket.Ajax.Call();
>     call.process(message);
>   }
>   else {
>     Wicket.Event.publish(topics.Message, message);
>   }
> };
> https://github.com/apache/wicket/blob/master/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to