Details
Description
Looking at:
Wicket just sets the Wicket-FocusedElementId header to the id of the element.
However according to:
http://w3c.github.io/html/single-page.html#element-attrdef-global-id
The id must not contain a space, other UTF-8 characters are allowed.
When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element’s tree and must contain at least one character. The value must not contain any space characters.
We got UTF-8 characters in our ids - now wicket fails to make Ajax calls with e.g. this error:
ERROR: Wicket.Ajax.Call.failure: Error while parsing response: TypeError: Cannot convert string to ByteString because the character at index 64 has value 328 which is greater than 255.
Because the Header value set in the code:
if (Wicket.Focus.lastFocusId) { headers["Wicket-FocusedElementId"] = Wicket.Focus.lastFocusId; }
has to be encoded and decoded on the backend (either base64, url encoding or something else which is allowed to be in a header).