1 Reply Latest reply on Sep 2, 2008 1:01 PM by Mikael Andersson

    Is this a good approach

    Tom Brown Newbie

      I'm implementing multi-select rowdatas using checkox, just like browse.xhtml in seam-dvd does. I put the persistence logic in Query, it works and save some @In operations. but i'am wondering whether it is a suitable to do that. Or anyone has a better solution?thx.

      <rich:dataTable id="holeList" var="hole" value="#{holeList.resultList}"
                                                   rendered="#{not empty holeList.resultList}">
                <f:facet name="header">CheckBox</f:facet>
                    <h:selectBooleanCheckbox value="#{holeSelections[hole]}" />

      public class HoleList extends EntityQuery {
           FacesMessages facesMessages;
           @Out(scope=ScopeType.EVENT, required = false)
           Map<Hole, Boolean> holeSelections;
           public void init(){
                holeSelections = new HashMap<Hole, Boolean>();
           public void deleteSelected(){
                EntityManager em = this.getEntityManager();
                List<Hole> resultList = this.getResultList();
                for (Hole item : resultList) {
                     Boolean selected = holeSelections.get(item);
                     if (selected != null && selected) {
                          holeSelections.put(item, false);
                facesMessages.add("delAction delete called");