Announcement

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

    listgrid.getAttribute(“”) returning “0” in case of “0.0000000001”

    Hi Isomorphic,

    I am using licensed version of SmartGWT PRO 4.1 (isc.version="v9.1p_2014-06-14/Pro Deployment";isc.versionNumber="v9.1p_2014-06-14";isc.buildDate="2014-06-14")

    Problem Statement
    1 Decimal value (for example 0.0000000001) is getting rendered in exponential format in Editable ListGrid.
    2 This problem has been solved by using CellFormater but while retrieving the value from ListGrid for persistence I am getting 0 in case of 0.000000000001.

    Implementation
    I have used ListGrid to view the Records, TextItem to get input data and ListGridType as FLOAT.

    Regards,
    Pratik Thaker


    #2
    This is too little information to go on. It could be that the APIs you are calling are forcing conversion to String or Integer, or that you have type declared as integer in one place and float in another, or many other things.

    The right approach to solve this is to use the advice in the Debugging topic in JavaDoc to try to create a minimal, standalone test case that reproduces the issue *in the latest, fully patched build* (see smartclient.com/builds). If you have such a test case, then we can look into this as a possible framework bug; more likely you will find a problem in your own code in the process of trying to create a test case.

    Comment


      #3
      Hi Isomorphic,

      I have tested It with FloatItem and ListGridItem type as Float , but its not working .
      Also have tried with these properties field.setDecimalPrecision(17) and field.setDecimalPad(17) but the result is same.
      Its creating issue only for values having no of "0" greater than 7 followed by an one digit Integer after decimal.
      Following are the test cases that might help
      0.000000001 not working returning 0
      0.000000000012 working
      0.000121321313211 working
      0.00000000000000002 not working
      0.00000000000000012 working

      Regards,
      Pratik Thaker

      Comment


        #4
        See previous response.

        However as far as troubleshooting your own code without actually creating a test case (which would allow us to help), you should google something along the lines of "floating point precision javascript" as it appears you may have an issue in this area.

        Comment


          #5
          Hi Isomorphic,

          Whenever I am trying to run the standalone case, I am facing below exception,


          com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.util.I18nUtil::initMessages(Lcom/smartgwt/client/i18n/SmartGwtMessages;)([Java object: com.smartgwt.client.i18n.SmartGwtMessages_@1095130060]): $wnd.isc.DateChooser.addProperties is not a function

          Comment


            #6
            This suggests that either some of the framework JavaScript is failing to load (or you skipped it), or that you are somehow using a newer version of SmartGWT.jar while loading JS resources from an older version.

            Comment

            Working...
            X