Announcement

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

    Empty text box return the string "null" instead of empty string

    In my code if something deletes the text in a form or in list grid the request to the server is the string null when it should be an empty string("")

    Someone else had asked in gwt but never got a reply.

    #2
    Here is a simplified version of what i had and what happens still occurs. I have tested it in firefox and google chrome. In firefox i used firebug to see the request sent to the server and it actually sends Region=null instead of just region=
    Code:
    isc.RestDataSource.create({
        ID:"facilitatorTable",
        dataFormat:"xml",
        dataURL:'load_facilitators.php',
        fetchDataURL:'load_facilitators.php',
        fields:[
    	{
    	  name: "FacilitatorId",
    	  title: "FacilitatorId",
    	  type: "text",
    	  primaryKey: true,
    	  canEdit: false,
    	  length: 200
    	},
    	{
    	  name: "FirstName",
    	  title: "FirstName",
    	  type: "text",
    	  canEdit: true,
    	  required: true,
    	  length: 200
    	},
    	{
    	  name: "LastName",
    	  title: "LastName",
    	  type: "text",
    	  canEdit: true,
    	  required: true,
    	  length: 200
    	},
    	{
    	  name: "email",
    	  title: "email",
    	  type: "text",
    	  canEdit: true,
    	  required: true,
    	  length: 200
    	},
    	{
    	  name: "Phone",
    	  title: "Phone",
    	  type: "text",
    	  canEdit: true,
    	  required: false,
    	  length: 200
    	},
    	{
    	  name: "Region",
    	  title: "Region",
    	  type: "text",
    	  canEdit: true,
    	  required: false,
    	  length: 200
    	}
        ]
    });
    
    
    isc.ListGrid.create({
            ID: "itemList",
     	width:"100%",
            height:"100%",
            dataSource:facilitatorTable,
            fields: [
                { name: "FacilitatorId" },
                { name: "FirstName" },
                { name: "LastName" },
                { name: "email" },
                { name: "Phone" },
                { name: "Region" }
            ],
            sortFieldNum: 0, 
            dataPageSize: 30,
            autoFetchData:true,
    	showFilterEditor: true,
            alternateRecordStyles:true,
    	showResizeBar:true
    
        });
    I thought this might be a common thing that needs something set to stop it.

    Comment


      #3
      What version is this (always include this)?

      What does the data look like and what is the exact (down to the keystroke) set of steps required to reproduce the message?

      Comment


        #4
        i think it might have been SmartClient 7.0RC2 LGPL . It was a while ago i actually downloaded and i can't see anything in the folders about version.


        And to reproduce do anything that results in the phone or region field being empty(del,backspace,...) and save(hit enter).

        It also did this with a dynamic form making the same field empty and hitting a save button

        Comment


          #5
          Try it in a nightly (smartclient.com/builds).

          Comment


            #6
            I downloaded the following and extracted it(after deleting the previous folder) and i still get the same result.
            http://www.smartclient.com/builds/lgpl/2010-07-08/

            Comment


              #7
              So is the issue that no one knows or that no one can reproduce it?

              Comment


                #8
                Hi,
                I'm also experiencing the same thing. But I don't consider it as an issue as what i do is: whenever I need to store its value to DB I check for the null value by if condition (though it's looking very bad my code having no. of if conditions for null value check). If I get null I replace it with a blank String myself.

                But above all even I'm looking forward to some conclusion of this question.

                Comment


                  #9
                  EDIT:

                  Sorry I forgot what the problem was.
                  It is very dodgy that i can not distinguish between a user that has typed NULL into a text field and a user that has an empty string.
                  Clearly these are very very different input, and i will never know why.
                  Last edited by andrewsirf; 29 Sep 2010, 22:25.

                  Comment

                  Working...
                  X