Announcement

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

    Bug with boolean fields

    Since I upgraded SmartGWT I am getting an error while validating these fields:
    Code:
    <field name="f_boolean_field" type="boolean" sqlStorageStrategy="number" />
    I get the validation error: "Muss eine ganze Zahl sein", which translated means: "It must be an integer.".

    The exact code worked with a previous version of smartgwt.

    Works with: SmartGWT 5.0p 2015-04-12 Power
    Does NOT WORK with: SmartGWT 5.0p 2015-09-01 Power

    I guess this is a regression errror. Could you please take a look?
    Using MSSQL Server 2014 as a DB.
    Last edited by edulid; 2 Sep 2015, 06:06.

    #2
    Hi Isomorphic,

    perhaps this is related to this boolean-item bug.

    Best regards
    Blama

    Comment


      #3
      Maybe, but this has worked before with 5.0p power.

      Comment


        #4
        Thanks for letting us know - we'll take a look

        Regards
        Isomorphic Software

        Comment


          #5
          Originally posted by Isomorphic View Post
          Thanks for letting us know - we'll take a look

          Regards
          Isomorphic Software
          Please let me know if you can reproduce the issue.

          Comment


            #6
            Update:

            the problem occurs only when autoDeriveSchema="true".

            Testcase:

            EntryPoint
            Code:
            public void onModuleLoad() {
            
            		VLayout vlayout = new VLayout(10);
            		
            		final DynamicForm df = new DynamicForm();
            		df.setDataSource(DataSource.get("testingDatasource"));
            		df.setSaveOperationType(DSOperationType.UPDATE);
            		Criteria c = new Criteria();
            		c.addCriteria("f_schueler_id", 110);
            		df.fetchData(c);
            		TextItem key = new TextItem("f_schueler_id");
            		MyCheckboxItem item = new MyCheckboxItem("f_vegetarier");
            		df.setFields(key,item);
            		vlayout.addMember(df);
            		
            		IButton button = new IButton("Validate");
            		button.addClickHandler(new ClickHandler() {
            			
            			@Override
            			public void onClick(ClickEvent event) {
            				boolean validated = df.validate();
            				SC.say(validated+"");
            				df.saveData();
            			}
            		});
            
            		vlayout.addMember(button);
            		vlayout.draw();
            	}
            DS.XML:
            Code:
            <DataSource ID="testingDatasource" serverType="sql"
            	tableName="t_schueler" autoDeriveSchema="true">
            
            	<fields>
            		<field name="f_vegetarier" type="boolean" sqlStorageStrategy="number" />
            
            	</fields>
            
            </DataSource>

            Comment


              #7
              Hi Isomorphic,

              were you able to reproduce the problem?

              Comment


                #8
                Our first attempt to reproduce this did not succeed. Could you please verify whether that error message is coming from the client or the server? If you switch on RPC tracking in the developer console, do you see a validation request go to the server and come back with a validation failure status (-4)? If not, that suggests the validation is failing client-side, which is what we would expect from your testcase code, but it is a bit mysterious why this would fail client-side due to autoDeriveSchema (which is a server-side thing).

                Can you also confirm that this code:
                Code:
                df.getValue("f_vegetarier");
                returns true or false immediately before you call df.validate()?

                Thanks,
                Isomorphic Software Support

                Comment


                  #9
                  Originally posted by Isomorphic View Post
                  If you switch on RPC tracking in the developer console, do you see a validation request go to the server and come back with a validation failure status (-4)? If not, that suggests the validation is failing client-side, which is what we would expect from your testcase code, but it is a bit mysterious why this would fail client-side due to autoDeriveSchema (which is a server-side thing).
                  No RPC request, so it fails on the client-side. Maybe there is something wrong with the field generation through autoderiveschema, that would also affect the validation on the client-side?

                  Can you also confirm that this code:
                  Code:
                  df.getValue("f_vegetarier");
                  returns true or false immediately before you call df.validate()?
                  Yes, depending on the value of the checkbox, it returns true or false. So this seems correct.

                  Comment


                    #10
                    Maybe the problem has to do with MSSQL Server 2014. We had in the past bugs with this, which you then corrected in smartGWT.
                    Specifically: the bug was corrected here:
                    Originally posted by Isomorphic View Post
                    Issue reported in this thread is fixed now. You may download nightly build for appropriate version (see below) and try it out.
                    - for 5.1 fix is available from 2015-01-31 build
                    - for 5.0 it will be available from 2015-02-03 (tomorrow) build
                    Last edited by edulid; 7 Sep 2015, 01:33.

                    Comment


                      #11
                      Ok, we'll take a look and update here when we have more information for you.

                      Comment


                        #12
                        Hello Isomorphic,

                        have you been able to reproduce the problem?

                        Comment


                          #13
                          Yes, we see the problem. Sorry for the delay - this is not as straightforward as just a bug that needs to be fixed. This started happening as a side-effect of a correct and desirable change in the server code, so we are having to work through what is necessary to retain that change while also correcting this problem. A developer is working on the problem right now.

                          Comment


                            #14
                            This issue has now been fixed. Please try your use case with a 5.0p build from tomorrow or later and let us know if you still see a problem.

                            Regards,
                            Isomorphic Software Support

                            Comment


                              #15
                              Yes, thanks, it seems to work, but with the new build I get a new bug: http://forums.smartclient.com/forum/...g-with-dialogs

                              Comment

                              Working...
                              X