Announcement

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

    DataSourceField with valueMap and "required:false" can't be edited to be empty

    Version:
    SmartClient_v83p_2013-03-20

    Example (w/o DataSource but same behaviour):
    Code:
    isc.FormLayout.create({
        items:[
            {
                name: "you",
                type: "text",
                title: "Choose value",
                valueMap:["A","B","C"],
                required:false
            }
        ]
    })
    The item is displayed as drop-down list. After you have selected a value you can't set the field empty again. I would expect, that this should be possible on fields with required set to false?

    It's only a testcase example. In my real app it's a DataSourceField with a valueMap from a ResultSet (and I don't want to inject a "void value" into this map as workaround) displayed by a DynamicForm.

    #2
    Set allowEmptyValue:true.

    Comment


      #3
      Works. But if the field is initially empty in a record, the resulting SelectList contains two empty entries?

      DataSource field definition:
      Code:
      	    {name:"PART_UFOR_ID", type:"intEnum", title:"Unternehmensform", detail:true,
      		    valueMap:window.dsUforLUData.getValueMap("UFOR_ID","UFOR_DISPLAY"),
      		    allowEmptyValue:true
      	    },
      Last edited by gho421; 18 Apr 2013, 23:07.

      Comment


        #4
        That would only happen if you provided a value that rendered as empty (due to valueMap or displayField) but the value itself was not null.

        Comment


          #5
          The empty value was delivered to RestDataSource as ...
          Code:
          <PART_UFOR_ID></PART_UFOR_ID>
          How to get it more empty?

          Checked behaviour with IE8 and Chrome 25.

          Comment


            #6
            Omit it entirely.

            Comment


              #7
              Works and even solved another problem.

              Comment

              Working...
              X