Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2762 in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    88
    Vote Rating
    3
    esag_dk is on a distinguished road

      0  

    Default ValueBaseField.isReadOnly always true (3.0.3)

    ValueBaseField.isReadOnly always true (3.0.3)


    ValueBaseField.isReadOnly returns always true in 3.0.3. See my example:

    Code:
    public class GXT_3_0 implements EntryPoint {
    
        public void onModuleLoad() {
            RootPanel.get().add(createMainPanel());
        }
    
    
        private Container createMainPanel() {
            VerticalLayoutContainer vlc = new VerticalLayoutContainer();
            vlc.setBorders(true);
            vlc.setPixelSize(600, 400);
    
    
            final TextField field = new TextField();
            field.setValue("test string");
    
    
            vlc.add(field);
    
    
            final TextButton button = new TextButton("readOnly = true");
            
            button.addSelectHandler(new SelectHandler() {
    
    
                @Override
                public void onSelect(SelectEvent event) {
                    field.setReadOnly(true);
                    field.setValue(String.valueOf(field.isReadOnly()));
                }
            });
            vlc.add(button);
            
            final TextButton button2 = new TextButton("readOnly = false");
            
            button2.addSelectHandler(new SelectHandler() {
    
    
                @Override
                public void onSelect(SelectEvent event) {
                    field.setReadOnly(false);
                    field.setValue(String.valueOf(field.isReadOnly()));
                }
            });
            vlc.add(button2);
    
    
            return vlc;
        }
    }
    It's because you've changed your implementation for setReadOnly:
    Code:
    public void setReadOnly(boolean readOnly) {    
        getCell().setReadOnly(true);
        getCell().getInputElement(getElement()).setReadOnly(readOnly);
      }
      
      public boolean isReadOnly() {
        return getCell().isReadOnly(); // <-- returns always true after a setReadOnly(true|false) call
      }

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,733
    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! This is clearly incorrect - this change initially occurred as part of a readonly attribute audit over all fields in 3.0.3, but apparently this mistake was made.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,733
    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


    This has been fixed in SVN and nightly builds, and will be available in the next release.

Thread Participants: 1