Skip to content

dojox/form/CheckedMultiSelect can not be cleared programatically probably due to a bug in dijit/form/_FormSelectWidgetMixin #183

@igorbga

Description

@igorbga

Description:
I have a CheckedMultiSelect widget configured to allow multiple values, if I call:

mywidget.set("value", ["value1", "value2"]);

Selects the two values as expected.
If I call:

mywidget.set("value", []);

Expected behaviour:
No value should be selected in the widgets and all the checkboxes should appear unchecked.

Actual behaviour:
The already selected checkboxes remain checked. Interestingly though, if you click in a different checkbox than the already selected one you will notice that the others are unchecked.

Doing mywidget.set("value", "") doesn't solve the problem either.

How to reproduce:
See this Fiddle: http://jsfiddle.net/41Lh0zoj/

More info:
I think that the problem is exactly here:

if(typeof val == "undefined" || typeof val[0] == "undefined"){

I don't think that checking 'typeof val[0] == "undefined"' is right, because like in this case, val might be an empty array and that seems perfectly fine to me. Doing this additional checks avoids calling _setDiaplsy and _updateSelection which is causing the reported problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions