Denis Gervalle wrote:
> Sergiu,
>
> Do you means that this trick is used because the save action of XWiki
> is unaware of the list of field shown to the user by the preceding
> inline action, and you do not know if a field should be updated or
> left unchanged when it is not sent back ?
Exactly.
> Denis
>
> On 23 sept. 08, at 18:54, Sergiu Dumitriu wrote:
>
>> Denis Gervalle wrote:
>>> Hi all,
>>>
>>> Does anyone here knows why displayEdit of ListClass fields with a
>>> display type of checkbox, radiobutton or select is always followed
>>> with a hidden input tag, having the same name than the visible
>>> control ?
>>>
>>> Here is an excerpt of the source code that cause this :
>>> if (!getDisplayType().equals("input")) {
>>> org.apache.ecs.xhtml.input hidden = new
>>> input(input.hidden, prefix + name, "");
>>> buffer.append(hidden);
>>> }
>>>
>>> I really wonder what is the need for that, and if I can remove it,
>>> since this seems to break some screen readers, that makes confusion
>>> between listbox and combobox due to this hidden field.
>>> Thanks in advance for any advices.
>>>
>> It is needed because of the way HTML forms work. Without the empty
>> field, you would not be able to unselect all options, because the
>> browser does not send back the field name if it doesn't have any value
>> to associate with it. The empty hidden field is used by the wiki
>> engine
>> to detect if it is a field with no values selected, or no field at
>> all.
>>
>> --
>> Sergiu Dumitriu
>> http://purl.org/net/sergiu/
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
>
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users