PDA

View Full Version : [FIXED] Tree throws exception when a single quote is in model key



nomad
20 Nov 2011, 1:04 PM
Tracing my code in dev mode I got

java.lang.IllegalArgumentException: String is not complete HTML (ends in non-inner-HTML context): <div id='x-widget-68_[hnsf'U]' class='GJA1Q0MMGB'>
Since the model key returned by ModelKeyProvider goes to element attribute as is
sb.appendHtmlConstant("<div id='" + id + "' class='" + style.node() + "'>"); it should be a valid HTML attribute string which is not obivious.

Escaping ' as &quot; also doesn't help: it unescapes implicitly making the node unselectable because com.sencha.gxt.widget.core.client.tree.Tree#findNode returns null:

String id = item.getId();
TreeNode<M> node = nodes.get(id);
id is "[hnsf'U]" while nodes contains "[hnsf&quot;U]" key.

Colin Alworth
30 Nov 2011, 7:29 PM
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.

darrellmeyer
6 Dec 2011, 8:07 AM
This is fixed in SVN (rev 1963). Changes will go out in next release later this week.

darrellmeyer
12 Dec 2011, 6:54 PM
Fixed in beta 1.