Closed Patrick1701 closed 2 years ago
@sebfz1 Ping :-)
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...
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
kind regards Patrick
@sebfz1 Ping :-)
Oh damned, thanks for the recall! I have been kind or very busy lately, I will have some time to look at it tomorrow (crossing fingers). Please reping early next week if I didn't replied in the meantime!
@sebfz1 I played a bit the last two hours, and all my mentioned problems disappear, when using the correct tag <select> in the markup file. So, I think, you could just add the following code to your MultiSelects classes, to prevent a client programer uses it wrong.
@Override
protected void onComponentTag(ComponentTag tag) {
// Must be attached to a select tag
checkComponentTag(tag, "select");
super.onComponentTag(tag);
}
I think, you can close this issue after this improvement. Patrick
Yes, it has to be a select
(form component). I added the suggested fix (8.x and 9.x branches for now).
Which wicket version are you now on?
@sebfz1 We are on 8.10.0 and unfortunately we will stay there for some months+.
Ok, I will try to cherry-pick the commits on a new branch from this release...
@sebfz1 No need. I applied the component check in our sub-class of yours. Just release it into the 8,x and 9.x Branch. More important to me is the feature #336 in an 8.10.x Version.
Hi Patrick, I released 8.13.0
and 9.5.0
.
If you need a specific version, please:
@sebfz1 I will have a try, to update to 8.13.0, first. I should do it anyway... Did you deploy 8.13.0 on maven central?
Yes, I deployed on Maven Central
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