Hybrid View
-
20 Nov 2011 1:04 PM #1
Tree throws exception when a single quote is in model key
Tree throws exception when a single quote is in model key
Tracing my code in dev mode I got
Since the model key returned by ModelKeyProvider goes to element attribute as isCode:java.lang.IllegalArgumentException: String is not complete HTML (ends in non-inner-HTML context): <div id='x-widget-68_[hnsf'U]' class='GJA1Q0MMGB'>
it should be a valid HTML attribute string which is not obivious.Code:sb.appendHtmlConstant("<div id='" + id + "' class='" + style.node() + "'>");
Escaping ' as " also doesn't help: it unescapes implicitly making the node unselectable because com.sencha.gxt.widget.core.client.tree.Tree#findNode returns null:
id is "[hnsf'U]" while nodes contains "[hnsf"U]" key.Code:String id = item.getId(); TreeNode<M> node = nodes.get(id);
-
30 Nov 2011 7:29 PM #2
Thanks, and yes, its a fairly obvious mistake that we will deal with. We will update this thread when a fix is available.
As a workaround, consider a custom ModelKeyProvider that encodes the string key before returning it.
-
6 Dec 2011 8:07 AM #3
This is fixed in SVN (rev 1963). Changes will go out in next release later this week.
-
12 Dec 2011 6:54 PM #4
Fixed in beta 1.
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote