-
17 Jan 2013 7:16 AM #1
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:
It's because you've changed your implementation for setReadOnly: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; } }
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 }
-
17 Jan 2013 11:16 AM #2
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.
-
23 Jan 2013 5:37 PM #3
This has been fixed in SVN and nightly builds, and will be available in the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTGWT-2762
in
3.0.4.


Reply With Quote