So it's like this.
MyMb:
@Named("MyMb")
@SessionScoped
public class MySuperCoolMb implements Serializable {
//Tons of attributes
private List<ListModelOne> lmo = new ArrayList();
//Tons of methods
}
Outter Model:
public class ListModelOne {
private coolObject object;
private List<ReadWrite> permissions;
//init()
//setters-getters
}
Inner Model, this is the Model that needs to be bind directly to the selectItems on screen
public class ReadWrite {
private String accessItem;
private boolean read = false;
private boolean write = false;
//Somewhere in my code i change this from true/false depending
//what i need and they do change in title in xhtml.
//setters-getters
}
And my xhtml:
<h3>Cool Title</h3>
<p:accordionPanel value="#{MyMb.lmo}" var="modelOne">
<p:tab title="#{modelOne.coolObject.ObjectName}">
<h3>Cool Inner Title</h3>
<ui:repeat value="#{modelOne.permissions}" var="readWrite">
<h:panelGrid>
<h:outputText value="#{readWrite.accessItem}"/>
<!-- selectManyCheckbox has no value attribute because i don't need/have a list/collection to bind it -->
<p:selectManyCheckbox>
<f:selectItem itemLabel="Read" itemValue="#{readWrite.read}" title="This is set to #{readWrite.read}"/>
<f:selectItem itemLabel="Write" itemValue="#{readWrite.write}" title="This is set to #{readWrite.write}"/>
</p:selectManyCheckbox>
</h:panelGrid>
</ui:repeat>
</p:tab>
</p:accordionPanel>
Everything works fine but the checkboxes (selectItem), can they be bound directly to an attribute of a class and ignote value of p:selectManyCheckboxes? Everything works fine on java, i've debugged and the values are right, they even print OK on "tittle" attribute in the f:selectItem (Some true, and some false)
PS: Also i couldn't understand the difference between ItemLabel, label, ItemValue, Value