Announcement

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

    [bug] SelectItem with multiple selections and required validator

    SmartClient Version: v10.0p_2015-06-30/Enterprise Development Only (built 2015-06-30)

    Chrome on OSX

    Please modify the #multiSelect sample like this:
    Code:
    isc.DynamicForm.create({
        ID:"exampleForm",
        width:450,
        fields: [
            {
                type:"select",
                title:"Select Multiple (PickList)",
                multiple:true, required:true,
                multipleAppearance:"picklist",
                valueMap: [ "Cat", "Dog", "Giraffe", "Goat", "Marmoset", "Mouse" ]
            },
    {name:"validateButton", type:"button", title:"Validate", click:function(form, item) {form.validate()}}
        ]
    });
    When you select an item, you'll get these warnings in the developer console:
    11:59:43.946:MUP5:WARN:SelectItem:isc_SelectItem_1:compareValues - this is a multiple FormItem but compareValues was called with a non-null first argument `value1` that is not an array.
    11:59:43.946:MUP5:WARN:SelectItem:isc_SelectItem_1:compareValues - this is a multiple FormItem but compareValues was called with a non-null first argument `value1` that is not an array.
    11:59:43.947:MUP5:WARN:SelectItem:isc_SelectItem_1:compareValues - this is a multiple FormItem but compareValues was called with a non-null second argument `value2` that is not an array.
    11:59:43.947:MUP5:WARN:SelectItem:isc_SelectItem_1:compareValues - this is a multiple FormItem but compareValues was called with a non-null first argument `value1` that is not an array.

    and if you click 'Validate' you'll get this error:

    12:00:30.321:MUP7:WARN:Log:TypeError: Cannot read property 'contains' of undefined
    Stack from error.stack:
    DynamicForm.addValidationError(<no args: exited>) on [DynamicForm ID:exampleForm] @ ISC_Core.js:3379:10
    DynamicForm.addValidationError(<no args: exited>) on [DynamicForm ID:exampleForm] @ ISC_Core.js:3377:1359
    DynamicForm.validate(<no args: exited>) on [DynamicForm ID:exampleForm] @ ISC_Forms.js:441:31
    [a]ButtonItem.click(<no args: exited>) on [ButtonItem ID:isc_ButtonItem_0 name:validateButton] @ [no file]:12:91
    ButtonItem.fireStandardHandler(<no args: exited>) on [ButtonItem ID:isc_ButtonItem_0 name:validateButton] @ ISC_Forms.js:1059:143
    ButtonItem.handleClick(<no args: exited>) on [ButtonItem ID:isc_ButtonItem_0 name:validateButton] @ ISC_Forms.js:1061:41
    [o]IButton.handleActivate(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Forms.js:1386:114
    IButton.handleClick(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Foundation.js:226:13
    [a][c]Class.invokeSuper(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Core.js:276:93
    [a][c]Class.Super(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Core.js:268:170

    #2
    Thanks for the notification - this recent regression has been fixed for tomorrow's builds.

    Comment


      #3
      SmartClient Version: v10.0p_2015-07-03/Enterprise Development Only (built 2015-07-03)

      Chrome on OSX

      Now if I click 'validate' with no option selected, I get this error:

      14:28:21.215:MUP7:WARN:Log:TypeError: Cannot read property 'contains' of undefined
      Stack from error.stack:
      DynamicForm.addValidationError(<no args: exited>) on [DynamicForm ID:exampleForm] @ ISC_Core.js:3378:10
      DynamicForm.addValidationError(<no args: exited>) on [DynamicForm ID:exampleForm] @ ISC_Core.js:3376:1359
      DynamicForm.validate(<no args: exited>) on [DynamicForm ID:exampleForm] @ ISC_Forms.js:441:31
      [a]ButtonItem.click(<no args: exited>) on [ButtonItem ID:isc_ButtonItem_0 name:validateButton] @ [no file]:12:91
      ButtonItem.fireStandardHandler(<no args: exited>) on [ButtonItem ID:isc_ButtonItem_0 name:validateButton] @ ISC_Forms.js:1059:143
      ButtonItem.handleClick(<no args: exited>) on [ButtonItem ID:isc_ButtonItem_0 name:validateButton] @ ISC_Forms.js:1061:41
      [o]IButton.handleActivate(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Forms.js:1386:114
      IButton.handleClick(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Foundation.js:226:13
      [a][c]Class.invokeSuper(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Core.js:276:93
      [a][c]Class.Super(<no args: exited>) on [IButton ID:isc_ButtonItem_0_button] @ ISC_Core.js:268:170

      Comment


        #4
        Give your item a name or a dataPath.

        We'll address the actual crash, but there's no current support for showing validation messages for items with no names.

        Comment


          #5
          SmartClient Version: v10.0p_2015-07-07/Enterprise Development Only (built 2015-07-07)

          ok, actually the error disappear when a name for the item is set.

          also the validation error is fixed, thank you very much.

          Comment

          Working...
          X