I think this is not a defect. You have two input fields with the same name "maxResults", the sling framework will now asume that the jcr property is of type String array, because the SlingHttpRequest contains two Values for the parameter name "maxResults".
1 person found this helpful
I assumed as much. I wonder if there is a better way handling this situation though, because it is definitely neither intuitive nor elegant. Maybe if there was a means to force a field to never become a multiple representation? Now I'm just getting into the realm of feature requests, which is offtopic. Thanks for the quick response, mkiti.
In fact it is possible to force a type. You can try following:
Add this to your dialog.xml (if you use xml to define dialogs, if not than you have to create the node maxResultsTypeHint manually)
In fact it is possible to force a type.
But you won't have control over which value is written. Since the parameters end up in a hash on the server-side, it could be either value. Unless you make sure they are always identical on the client-side.
However, I think I would rather redesign the dialog to not duplicate the value. Or you have one (extjs) field simply display & update the value of the other one, without actually using a form field that is submitted.