Announcement

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

    Bug in current nightlies: redrawOnChange swallows empty values

    A select box with allowEmptyValue: true and redrawOnChange: true will be discarded from the form/value manager when the empty value is chosen. See the difference in the example below between redrawOnChange set to true (field 'ship1') or false (field 'ship2'). Change both select boxes to empty, press "Submit" and check the console output: 'ship1' is mistakenly not included in vm.getValues() when the empty value is chosen, 'ship2' is correctly included with its empty value.

    Code:
    isc.ValuesManager.create({
            ID: "vm"        
    });
    
    isc.VLayout.create({
        width: 400,
        height: 300,
        membersMargin: 10,
        members : [
            isc.TabSet.create({
                    ID: "theTabs",
                height: 250,
                tabs: [
                    {title:"Item",
                        pane: isc.DynamicForm.create({
                            ID: "form0",
                            valuesManager:"vm",
                            fields: [
                                {name: "itemName", type:"text", title:"Item"},
                                {name: "description", type:"textArea", title:"Description"},
                                {name:"price", type:"float", title: "Price"} 
                            ]
                        })
                    },
                    {title:"Stock", 
                        pane: isc.DynamicForm.create({
                            ID: "form1",
                            valuesManager:"vm",
                            fields: [
                                {name: "inStock", type:"checkbox", title:"In Stock"},
                                {name: "ship1", type: "select", allowEmptyValue: true, emptyDisplayValue: "Choose shipment:", valueMap: {train: "Train", boat: "Boat"}, redrawOnChange: true},
                                {name: "ship2", type: "select", allowEmptyValue: true, emptyDisplayValue: "Choose shipment:", valueMap: {train: "Train", boat: "Boat"}},
                                {name: "nextShipment", type:"date", title:"Next Shipment",
                                    useTextField:"true", showIf: "form1.getValue('ship1') != null"
                                }                                
                            ]
                        })    
                    }
                ]
            }),
            isc.Button.create({
                title:"Submit",
                click : function () {
                    vm.validate();
                    if (form1.hasErrors()) theTabs.selectTab(1);
                    else theTabs.selectTab(0);
                    console.log(vm.getValues());
                }
            })    
        ]
    });
    vm.setValues({ship1: "train", ship2: "boat"});
    Note: I edited the bug report to clarify the issue, it occurs when you set the select boxes to empty which had an old value != null.
    Last edited by ect; 1 Jul 2010, 03:05.

    #2
    Sorry to pop this up, but this bug is still present in SC_SNAPSHOT-2010-7-26.
    We have complex forms with lots of select boxes with optional content. The end user must be able to chose a value, save, and later decide to set the value to empty and save again.
    For each select box with redrawOnChange: true that has been reset to empty the post parameter is missing in the DataSource.update request. Currently we need to add each affected item to the update requests manually (in DataSource.transformRequest), which is quite cumbersome and error-prone...
    The code snippet above should illustrate the issue, or do you need more information? Will this issue be addressed soon?

    Comment


      #3
      You're not marked as having support. If this is an error, please call the main line and have it corrected right away.

      Comment


        #4
        No, you're right, we do not have support - we are only trying to help that a brilliant library can be even further improved and thought you're interested that also LGPL users are posting bugs that break existing applications when upgrading SC versions.
        When there is no feedback for a month (a small line would be enough, like "Thanks for notifying us about this issue. We'll look into that matter."), it might well happen that a post is being popped up to make sure this report hasn't got lost. I know it seems to be extra effort at first glance but it might even save your time when other users know this is an accepted issue and being looked at.

        Comment


          #5
          Sorry, we get too many bogus reports, and this issue is too obscure to look into even if validated. Realize, there are many things we can be doing to improve the framework for all users instead of looking into a bug that affects only you and has a simple workaround, so the community would not want us to spend time on this report. That's why you should get support if you've got business applications relying on our software.

          Comment

          Working...
          X