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
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to