PDA

View Full Version : [OPEN] [CLOSED] Bug in BaseModel



nyklogistics
4 Jul 2008, 7:08 PM
- Detailed description of the problem
Getting null when the property name has a dot.

- GXT version
gxt-1.0_rc2

- Host mode / web mode / both
both

- Browser and version
FireFox 3.0 / Internet Explorer 6.0.2900.2180.xpsp.051011-1528

- Operating System
Windows XP Professional

- Sample code


public class Test implements EntryPoint {
public void onModuleLoad() {

BaseModel b = new BaseModel();

b.set("abc.def", "a");

b.set("abcdef", "b");

Window.alert((String) b.get("abc.def"));

Window.alert((String) b.get("abcdef"));
}
}

darrellmeyer
7 Jul 2008, 10:23 AM
You should not use "." when setting properties. The dot is used when retrieving nested properties.


public void onModuleLoad() {
BaseModel b = new BaseModel();
BaseModel c = new BaseModel();
c.set("def", "hello");
b.set("abc", c);
b.set("abcdef", "b");
Window.alert((String) b.get("abc.def"));
Window.alert((String) b.get("abcdef"));
}