[jboss-user] [JBoss Seam] - EL-enhancements implementation question

Sammy8306 do-not-reply at jboss.com
Mon Apr 16 07:19:13 EDT 2007


Is it correct that the el-enhancements use the index of an object in the List that backs the h:datatable? E.g. :


  | <h:dataTable value="#{blogList.entries}" var="entry" >
  |    <h:column>
  |       <f:facet name="header">Title</f:facet>
  |       <h:outputText value="#{entry.title}"/>
  |    </h:column>
  |    ....
  |    <h:column>
  |       <f:facet name="header">Action</f:facet>
  |       <h:commandButton value="Delete" action="#{blogList.delete(entry)}"/>
  | </h:column>
  | 

blogList.entries contains a statement that returns a new ArrayList(someSet), so the order of the ArrayList is not deterministic and changes between requests. When invoking the delete action, not the object identity of entry but it's location in the list determines what entry gets deleted... Not a big problem (work around is to fix the ordering of the set), just wanted to see whether this could be improved since it counters the intuition of normal call-by-reference which is implied by the notation.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037502#4037502

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037502



More information about the jboss-user mailing list