Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-3663 in 3.0.7.
  1. #1
    Sencha Premium Member
    Join Date
    Aug 2013
    Posts
    7
    Vote Rating
    0
    zoec is on a distinguished road

      0  

    Default TwinTriggerFieldDefaultAppearance doesn't check for isEditable()

    TwinTriggerFieldDefaultAppearance doesn't check for isEditable()


    Hi,

    I couldn't see a duplicate for this in the forums.

    We're using GXT 3.0.6. We have some IntegerSpinnerFields that we've set setEditable(false) on, but it has no effect. I looked into it, and found that whilst TriggerFieldDefaultAppearance has a renderInput method that correctly deals with this setting, TwinTriggerFieldDefaultAppearance does not use renderInput and does not check options.isEditable(). I fixed it by merging the two render methods together in our own subclass of SpinnerFieldDefaultAppearance, as follows:

    Code:
        @Override
        public void render(SafeHtmlBuilder sb, String value, FieldAppearanceOptions options)
        {
            int width = options.getWidth();
            boolean hideTrigger = options.isHideTrigger();
    
    
            if (width == -1)
            {
                width = 150;
            }
    
    
            SafeStylesBuilder inputStyles = new SafeStylesBuilder();
            String wrapStyles = "";
    
    
            if (width != -1)
            {
                wrapStyles += "width:" + width + "px;";
                // 6px margin, 2px border
                width -= 8;
                if (!hideTrigger)
                {
                    width -= resources.triggerArrow().getWidth();
                }
                inputStyles.width(width, Unit.PX);
            }
    
    
            sb.appendHtmlConstant("<div style='" + wrapStyles + "' class='" + style.wrap() + "'>");
    
    
            if (!options.isHideTrigger())
            {
    
    
                sb.appendHtmlConstant("<table width=100% cellpadding=0 cellspacing=0><tr><td>");
                renderInput(sb, value, inputStyles.toSafeStyles(), options);
                sb.appendHtmlConstant("</td>");
    
    
                sb.appendHtmlConstant("<td>");
                sb.appendHtmlConstant("<div class='" + style.trigger() + "'></div>");
                sb.appendHtmlConstant("<div class='" + style.twinTrigger() + "'></div>");
                sb.appendHtmlConstant("</td></table>");
            }
            else
            {
                renderInput(sb, value, inputStyles.toSafeStyles(), options);
            }
    
    
            sb.appendHtmlConstant("</div>");
    
    
        }
    I also had to redeclare the properties resources and style because they're declared private, in most other cases you declare them protected which makes life much easier.

    Thanks,
    Zoe

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

    Note that instead of overriding the private fields, you could also use jsni to access them.

  3. #3
    Sencha - GXT Dev Team jhickman's Avatar
    Join Date
    Feb 2011
    Location
    Missouri
    Posts
    23
    Vote Rating
    2
    jhickman is on a distinguished road

      0  

    Default


    This bug has been fixed and will be available via SVN, nightly builds, as well as in the next release (3.0.7).

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    501
    Vote Rating
    15
    branflake2267 will become famous soon enough

      0  

    Default


    Just an update, GXT 3.0.7 has been released with this issue fixed in it.

    It can be downloaded:
    https://support.sencha.com/index.php#dash
    or
    http://docs.sencha.com/gxt/3.1/getti...ven/Maven.html
    Thanks,
    Brandon
    GXT Support

    ~ New GXT Guides ~
    http://docs.sencha.com/gxt/3.1/

    ~ Support Tickets ~
    https://support.sencha.com/index.php

    ~ Tips and Announcements Community ~
    https://plus.google.com/communities/110447085143928405373

    ~Training~
    Get on the Fast Track with Sencha Training http://sencha.com/training