Results 1 to 4 of 4

Thread: Tree throws exception when a single quote is in model key

Hybrid View

Previous Post Previous Post   Next Post Next Post
    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.
  1. #1
    Sencha User
    Join Date
    Sep 2009
    Posts
    13
    Vote Rating
    0
      0  

    Default Tree throws exception when a single quote is in model key

    Tracing my code in dev mode I got
    Code:
    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
    Code:
          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:
    Code:
          String id = item.getId();
          TreeNode<M> node = nodes.get(id);
    id is "[hnsf'U]" while nodes contains "[hnsf&quot;U]" key.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Vote Rating
    93
      0  

    Default

    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.

  3. #3
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
      0  

    Default

    This is fixed in SVN (rev 1963). Changes will go out in next release later this week.

  4. #4
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
      0  

    Default

    Fixed in beta 1.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •