Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    [SmartGWT4] FormItem.getValue suddenly returns an ArrayList

    Hello,

    We are experiencing altered behavior on the FormItem.getValue return value in some cases. It is now returning an array list whereas before (3.1) it returns a JS object.

    On the 4.0

    Code:
    public native Object _getValue() /*-{
    var self = this.@com.smartgwt.client.core.DataClass::getJsObj()();
    var ret;
    if(self.setValue) {
    ret = self.getValue();
    } else {
    ret = self.value;
    }
    ret = $wnd.SmartGWT.convertToJavaType(ret);
    // $wnd.SmartGWT.convertToJavaType() returns JS arrays identically. See r1498.
    if ($wnd.isc.isAn.Array(ret)) {
    ret = @com.smartgwt.client.util.JSOHelper::convertToList(Lcom/google/gwt/core/client/JavaScriptObject;)(ret);
    }
    return ret;
    }-*/;
    and on 3.1

    Code:
    public native Object _getValue() /*-{
    var self = this.@com.smartgwt.client.core.DataClass::getJsObj()();
    var ret;
    if(self.setValue) {
    ret = self.getValue();
    } else {
    ret = self.value;
    }
    return $wnd.SmartGWT.convertToJavaType(ret);
    }-*/;
    We think this might have to do with a recent changes for which we already got a fix in 'isc_FormItem_mapValueToDisplay'. We think this method here should also look at the 'multiple' setting of the field when checking for 'isAn.Array'.

    This is on SNAPSHOT_v9.0d_2013-02-27/Pro Deployment 2013-02-27.

    Thanks for advising.
    Last edited by hin3x; 28 Feb 2013, 00:43.

    #2
    We have reviewed the implementation and agree that we should only be converting to a list when the formItem is marked as multiple:true.
    We've made this change. Please try the next nightly build and let us know if you continue to have problems with this.

    Thanks
    Isomorphic Software

    Comment


      #3
      This works thanks!

      Comment

      Working...
      X