Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext User
    Join Date
    Sep 2007
    Posts
    13
    Vote Rating
    0
    abent is on a distinguished road

      0  

    Default XTemplate can't access the attribute with "is" style getter method

    XTemplate can't access the attribute with "is" style getter method


    Required Information

    Version(s) of Ext GWT
    «Ext GWT 3.0.1»

    Browser versions and OS
    (and desktop environment, if applicable)
    • Chrome 24, Windows XP
    Virtual Machine
    No

    Description
    "com.sencha.gxt.core.rebind.Context" only check the "get" method, regardless of the "is" method, cause boolean attributes of my model class cannot be detected and bound to a context. Please see com.sencha.gxt.core.rebind.Context line 70(v3.0.1).

    Run mode
    development mode

    Steps to reproduce the problem
    1. model class "User" has a boolean attribute named "allowed", and the getter named "isAllowed()".
    2. XTemplate(...<b>{allowed}</b>...) render a user object.
    3. treelogger report a error:Reference could not be found: 'allowed'. Please fix the expression in your template.
    4. debug code,Context.knownValues have no "allowed" attribute.
    Expected result
    Attributes of Java Bean class can be access in XTemplate.

    Actual result
    The attribute with "is" style getter method can't be access in XTemplate

    Test case
    Code:
    public class User implements Serializable{
      private boolean allowed;
    
      public boolean isAllowed(){
        return allowed;
      }
    
      public void setAllowed(boolean allowed){
        this.allowed = allowed;
      }
    }
    
    interface UserTemplate extends XTemplates {
      @XTemplate(source = "template.html")
      SafeHtml draw(User user);
    }
    
    template.html
    <b>{allowed}</b>
    
    User user = new User();
    user.setAllowed(true);
    SafeHtml html = ((UserTemplate)GWT.create(UserTemplate.class)).draw(user);

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Posts
    1,927
    Vote Rating
    55
    Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough

      0  

    Default


    Please stop reposting this - as a relatively new user, it was caught in the spam filter, and I've approved it and deleted your other two messages.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Posts
    1,927
    Vote Rating
    55
    Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough

      0  

    Default


    This was reported in http://www.sencha.com/forum/showthread.php?240556 and fixed in 3.0.2.

    As noted in that bug, there is a workaround - refer to {user.allowed} instead of just {allowed}.

Tags for this Thread