1. #1
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    226
    Vote Rating
    3
    The_Jackal is on a distinguished road

      0  

    Default [1.2.3] BeanModel getProperties returns empty map

    [1.2.3] BeanModel getProperties returns empty map


    BeanModel getProperties() returns an empty map while getPropertyNames() returns a collection of the properties.

    Debugging shows that the map field is null - even after an explicit set is called.

    I propose that getProperties should override the getProperties in BaseModelData and return the beanProperties (much like the getPropertyNames method does).

    Currently it means that to set one BeanModel from another I have to do this:

    Code:
           
    Collection<String> props = source.getPropertyNames();
    for (String prop : props)
    {
         target.set(prop, source.get(prop));
    }
    where I'd like to do this:

    Code:
    target.setProperties(source.getProperties());

  2. #2
    Ext User
    Join Date
    Jan 2009
    Posts
    18
    Vote Rating
    0
    xferron is on a distinguished road

      0  

    Default


    Sadly, I reported this problem a while back when the bug existed in 1.2.2 and no one replied or did anything.

    The bug unfortunately still didn't get fixed in 1.2.3.

    The main reason behind the problem is that BeanModel generator doesn't generate a corresponding getProperties() method to override the ModelData's base getProperties() method. What this means is that when you call getProperties(), you're actually getting the properties in the BaseModelData's hashmap properties, which BeanModel doesn't use.

    Currently, I'm doing the same thing you are when it comes to dealing with this. However, there are many dependencies on this getProperties() method in the GXT library, ie. DataViewBinder. So basically, ANY component that uses getProperties() will fail horribly when you use a BeanModel.

    Please fix this, GXT team. It'd be greatly appreciated!

Thread Participants: 1