Announcement

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

    4.1 Upgrade issue with getting boolean form record

    I have upgraded from 4.0 to 4.1 and since doing that a large number of pages have broken in my application relating to getting boolean values.

    In a data source when mapping data anytime getAttributeAsBoolean is called I get an error, what is strange however is...

    Code:
    listGrid.getSelectedRecord().getAttributeAsObject("email")
    returns Boolean = True

    However getAttributeAsBoolean() gives an error

    Code:
    Something other than a Java object was returned from JSNI method '@com.smartgwt.client.core.DataClass::getAttributeAsBoolean(Ljava/lang/String;)': JS value of type boolean, expected java.lang.Object
    Now although frustrating, I do have a utility class which I use to grab the boolean values now...

    Code:
    public static boolean getAttributeAsBoolean(Record record, String attributeName) {
    	if (record.getAttributeAsObject(attributeName) instanceof Boolean) {
    		return BooleanUtils.isTrue((Boolean)record.getAttributeAsObject(attributeName));
    	} else if (record.getAttributeAsObject(attributeName) instanceof String) {
    		return Boolean.parseBoolean(record.getAttribute(attributeName));
    	}
    	return false;
    }

    First, just to confirm, this is a bug right and not expected behavior? Is there workaround or will I need to wait for nightly build with this fixed?

    Thanks,
    Dale

    GWT Version : 2.4.0
    SmartGWT Version : 4.1p
    SmartGWT Build Date : 03/08/2014 06:16
    Last edited by ellisd5; 5 Aug 2014, 03:44. Reason: Last part was in correct, further testing showed it was ok

    #2
    There was a similar problem reported yesterday which has already been fixed in the SGWT 4.1p build released today. However, it wouldn't be present in the build you mention you're using, 4.1p from 03/08/2014 06:16 - are you sure you've posted the correct info?

    Comment


      #3
      I have an about page in my application which displays the version numbers, which is where I got the information from...

      Code:
      getLabel("GWT Version", GWT.getVersion()),
      getLabel("SmartGWT Version", com.smartgwt.client.Version.getVersion()),
      getLabel("SmartGWT Build Date", DateUtils.formatDateTime(com.smartgwt.client.Version.getBuildDate())),
      I'd assume that information is correct. I'll get the latest nightly build tomorrow morning and see if the issues resolved.

      Thanks,
      Dale

      Comment


        #4
        This is the other thread that appears to report the issue:

        http://forums.smartclient.com/showthread.php?t=30935

        Comment


          #5
          Thanks Isomorphic,

          The nightly build seems to have resolved that issue

          Comment

          Working...
          X