The "selected" attribute can be used to define if a checkbox should be checked by default when it is displayed on a Visualforce Page.
This works correctly when defined in a simple single apex:inputcheckbox tag in a form, but when this tag is present inside a repeat tag, the selected attribute has no affect. See the following example code:
<apex:form>
Single Checkbox:<br/>
<apex:inputCheckbox selected="true"/>
<br/><br/>Repeated Checkbox:<br/>
<apex:repeat value="{!availableProducts}" var="myVar">
<apex:inputCheckbox selected="true"/>
</apex:repeat>
</apex:form>
Here is the resulting output when I load the page:
As you can see, the repeated checkbox doesn't get automatically selected. When inspecting the html, I see that the "checked" value doesn't get set in these repeated checkboxes like it does with the singular version. Am I missing something in terms of correct usage, or is this a problem with the attribute?