Results 1 to 3 of 3

Thread: ValueBaseField.isReadOnly always true (3.0.3)

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 EXTGWT-2762 in 3.0.4.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    88
    Vote Rating
    3
      0  

    Default 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,737
    Vote Rating
    93
      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,737
    Vote Rating
    93
      0  

    Default

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

Posting Permissions

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