Announcement

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

    localecurrency?

    I have a field of type localecurrency and it seems to not work well (using german locale)
    If I type "67,98", which is correct in german, smartgwt changes it to "67.98". If I then edit this field (not changing anything), smartgwt changes it to 6798.
    And this is not correct.

    If I type "67.98" directly, smartgwt changes it also to 6798. So something doesn't looks right here.
    This also happens if I change the field to the type "float".

    Using smartgwt 6.0-p20160804 power.

    Code:
    public void onModuleLoad() {
            ListGrid lg = new ListGrid();
            lg.setDataSource("stammBuecher");
            lg.setCanEdit(true);
            lg.setAutoSaveEdits(false);
            ListGridField f = new ListGridField("f_preis");
            lg.setFields(f);
            
            lg.setWidth100();
            lg.setHeight100();
            
            lg.draw();
            
            lg.fetchData();
      }
    Code:
    <DataSource ID="stammBuecher" serverType="sql" tableName="t_stamm_buecher"
        serverConstructor="de.mks_infofabrik.kids.server.KidsDataSource">
        <fields>
            <field name="f_id" type="sequence" primaryKey="true" />
            <field name="f_preis" type="localecurrency" />
        </fields>
    
    </DataSource>
    The field f_preis is of type: numeric(18,2) (MSSQL).

    Click image for larger version

Name:	Bildschirmfoto 2016-09-12 um 15.38.19.png
Views:	80
Size:	10.1 KB
ID:	240160Click image for larger version

Name:	Bildschirmfoto 2016-09-12 um 15.38.39.png
Views:	76
Size:	9.9 KB
ID:	240162Click image for larger version

Name:	Bildschirmfoto 2016-09-12 um 15.38.44.png
Views:	73
Size:	9.9 KB
ID:	240163Click image for larger version

Name:	Bildschirmfoto 2016-09-12 um 15.38.49.png
Views:	74
Size:	9.3 KB
ID:	240164
    Attached Files

    #2
    Type names are case sensitive, you want "localeCurrency" not "localecurrency".

    Comment


      #3
      Ok, changing this to "localeCurrency" works better. But it still has problems.

      Steps:
      1. Write 6,78
      2. Focus off: the field changes to € Eur 6,78. This is correct
      3. Change to 6.78. A validation error appears. This is correct.
      4. Change again to 6,78. The validation error never disappears. The error says: "Is must be a decimal number" (translated to english)

      Comment


        #4
        Isomorphic have you been able to reproduce the issue?

        Comment


          #5
          Yes, it's been reproduced - we'll update here when it's been addressed.

          Comment


            #6
            Isomorphic any update on this ?

            Comment


              #7
              This is fixed for tomorrow's builds.

              Comment


                #8
                Hi Isomorphic. I am having a similar problem to what edulid describes in his third post in this thread. In particular, using es_CO, when I type a decimal like 0,3333 in a "localeFloat" type of field (which expects the comma to be used as decimal separator for this locale), the value is properly recognized. But changing the value to 0.3333 generates an undefined exception:

                *08:27:48.027:KPR7:WARN:Log:java.lang.ClassCastException [No error.stack available]
                Breaking on exception: java.lang.ClassCastException
                This exception might be the cause of what edulid describes as "the validation never disappears", since after the exception, the application stops responding.

                This is also true when I try to use the point as decimal separator in "localeCurrency" fields with this locale.

                Since I just upgraded to SmartGWT 6.0p 2016-09-17 and the problem is still there, can you please validate if this is the version where this fix was meant to be included?

                Thanks!
                Last edited by carlossierra; 19 Sep 2016, 05:42.

                Comment


                  #9
                  Your build should have the fix. However, since the original problem did not result in an exception, you appear to be dealing with some other kind of problem. Try posting more details, but use a new thread.

                  Comment


                    #10
                    Originally posted by Isomorphic View Post
                    This is fixed for tomorrow's builds.
                    Thanks, this works now

                    Comment

                    Working...
                    X