Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Sep 2010
    Vote Rating
    zalant is on a distinguished road


    Default [FNR] BeanModelGenerator wrap list in a list on set() for non BeanModel items

    GXT v2.2.0

    When set a list in BeanModel and items of this list are not instances of BeanModel then the list is wrapped in a new list.

    public class TestBean implements BeanModelTag {
        private List<String> list;
        public List<String> getList() {
            return list;
        public void setList(List<String> list) {
            this.list = list;
    public class Test implements EntryPoint {
        public void onModuleLoad() {
            TestBean bean = new TestBean();
            BeanModel beanModel = BeanModelLookup.get().getFactory(TestBean.class).createModel(bean);
            List<String> originalList = new ArrayList<String>();
            beanModel.set("list", originalList);
            List<?> resultList = beanModel.get("list");
            GWT.log("originalList: " + originalList.toString());
            GWT.log("resultList: " + resultList.toString());
    originalList: [Hello, World]
    resultList: [[Hello, World], [Hello, World]]

    The problem is in BeanModelGenerator.createSetMethods line 296:
    protected void createSetMethods(List<JMethod> properties, SourceWriter sw, String typeName) {
        . . .
        sw.println("} else if (obj instanceof java.util.List) {");
          sw.println("java.util.List list = new java.util.ArrayList();");
          sw.println("for(Object o : (java.util.List) obj) {");
            sw.println("if(o instanceof BeanModel) {");
              sw.println("list.add(((BeanModel) o).getBean());");
            sw.println("} else {");
            sw.println("list.add(obj);");       // NOTE: Here should be "list.add(o);"
          sw.println("obj = list;");
        . . .

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Vote Rating
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light



    Thanks for the report. there was already a patch pending. Fixed in SVN as of revision 2232

Similar Threads

  1. Combobox inner list not aligning list items propertly ?
    By ritesh.kapse in forum Ext 2.x: Help & Discussion
    Replies: 13
    Last Post: 29 Oct 2010, 5:29 AM
  2. Replies: 1
    Last Post: 30 Aug 2010, 7:22 AM
  3. [FNR] Grid stripes break row class name list
    By pointserve in forum Ext GWT: Bugs (2.x)
    Replies: 1
    Last Post: 3 Mar 2010, 4:41 AM
  4. Replies: 1
    Last Post: 19 Nov 2009, 5:54 AM
  5. [FNR] DND List-to-List INSERT 1.2.4 demo throwing JS errors
    By Baby Dingo in forum Ext GWT: Bugs (1.x)
    Replies: 2
    Last Post: 12 May 2009, 3:05 PM

Thread Participants: 1

Tags for this Thread