Skip to content

SelectOneMenu: Please add a “clear” Ajax Behavior in editable mode #12067

@EugenFischer

Description

@EugenFischer

Description

If the component p:selectOneMenu is switched to editable mode,
there is no dedicated event if the previously selected value was changed or deleted via the keyboard.
Only a blur event triggers a change event.

Describe the solution you would like

It will be nice if on clear the change event get also triggert.
Or a dedicated "clear" Ajax Behavior could be registered.

Additional context

My dirty "monkey patch"

PrimeFaces.widget.SelectOneMenu

...
bindEvents {
...
       //onchange handler for editable input
        if (this.cfg.editable) {
            this.label.on('change', function (e) {
                $this.triggerChange(true);
                $this.callHandleMethod($this.handleLabelChange, e);
            });
           // trigger change on input event
            this.label.on('input', function (e) {
                $this.triggerChange(true);
                $this.callHandleMethod($this.handleLabelChange, e);
            });
        }
...
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions