sebfz1 / wicket-jquery-ui

jQuery UI & Kendo UI integration in Wicket
http://www.7thweb.net/wicket-jquery-ui/
Other
92 stars 58 forks source link

AjaxMultiSelect / unknown but important parameter #334

Closed Patrick1701 closed 2 years ago

Patrick1701 commented 3 years ago

Hi Sebastien, do you know, which code creates the parameter, named like the multiselect itself?

Sometimes its missing and the multi select ajax feature is not working. The parameter 'value' is always present. And it seems this parameter is the implemented one. But I cannot get it, where the other parameter comes from?

The parameter 'value' does not update the internal model-object. Thats the bug, I'm searching for...

kind regards Patrick

grafik

Patrick1701 commented 3 years ago

@sebfz1 Ping :-)

sebfz1 commented 3 years ago

Hi Patrick,

The value is provided to respect the contract with the on-change event, like stated in the doc: https://docs.telerik.com/kendo-ui/api/javascript/ui/multiselect/events/change

But it is not used to update the model here and is not intended to - IIRC. The OnChangeAjaxBehavior is the generic behavior aim to be bound to on-change. We may need to use or retransmit the value being retrieved or not (the AutoComplete for instance)

The components (like DropDown, ComboBox, MultiSelect, etc) are FormComponent. The Wicket's internal are in charge of retrieving/converting the data (and then the model is updated). The parameter you are seeing (having the name of the component) is the one the form supplies. If your component is not in a Form, that might explain your issue...

Patrick1701 commented 3 years ago

Hi Sebastien,

Question: Ok, but why does the toplevel component MultiSelect tries to read the data using convertInput() -> getInputAsArray() -> getParameterValues(getInputName())?

And: It don't gets the parameter 'value' sent by the request, because the getInputName() has a random name, given by wicket for reading form submits/parameters. If I override the method getInputName() and set a hard return value "value", the MultiSelect behaves as expected. Then the getParameterValues() retrieves the value 'value' sent via ajax and writes it into the modelobject.

Is it a bug? Or can it be a feature request? What do you think?

Suggestion: If I use the MultiSelect in a form submit case, but maps it incorrectly to a <div> instead of <select>, the form submit does not work correct. You should provide a check onComponentTag() like wicket does for different components, when mapping it to wrong mark-up tags.

(The reason: If not an original