selectBooleanCheckbox and dataScroller
fabboco Nov 4, 2006 6:06 AMHi,
I have a dataTable that uses a dataScroller and selectBooleanCheckbox.
First problem is that selected items get deselectd when I move from one page to the other.
So I tryed to manage selected items myself. Second problem is that when I move from one page to the other the findAll function is called but selections is empty (see attached code).
Please help me!
Thank you
Regards
Fab.
Jboss 4.0.4 GA PATCH 1
Seam 1.0.1.GA - (Seam CVS.20061031 has the same behavior)
Tomahawk 1.1.3
<t:dataTable id="b5" var="b5" rows="10" preserveDataModel="false" value="#{b5List}" width="100%" headerClass="listColumnTitle" rowClasses="listColumn" columnClasses="columnCenter,columnActions,columnLeft,columnLeft" > <h:column> <t:selectBooleanCheckbox id="selections" value="#{B5Manager.selections[b5]}" /> </h:column> .... </t:dataTable> <t:dataScroller id="scroll_1" for="b5" fastStep="10" pageCountVar="pageCount" pageIndexVar="pageIndex" styleClass="scroller" paginator="true" paginatorMaxPages="9" paginatorTableClass="paginator" paginatorActiveColumnStyle="font-weight:bold;" > <f:facet name="first" > <t:graphicImage url="../img/arrow-first.gif" border="1" /> </f:facet> ....... </t:dataScroller> <t:dataScroller id="scroll_2" for="b5" rowsCountVar="rowsCount" displayedRowsCountVar="displayedRowsCountVar" firstRowIndexVar="firstRowIndex" lastRowIndexVar="lastRowIndex" pageCountVar="pageCount" pageIndexVar="pageIndex" > <h:outputFormat value="#{msgs.Application_dataScrollerInfo}" styleClass="standard" > <f:param value="#{rowsCount}" /> <f:param value="#{displayedRowsCountVar}" /> <f:param value="#{firstRowIndex}" /> <f:param value="#{lastRowIndex}" /> <f:param value="#{pageIndex}" /> <f:param value="#{pageCount}" /> </h:outputFormat> </t:dataScroller> <h:commandLink value="Seleziona" action="#{B5Manager.select}" onclick=";" styleClass="button" style="width:45pt" />
@Stateful @Name("B5Manager") @Scope(ScopeType.SESSION) public class B5ManagerBean implements Serializable, B5Manager { @PersistenceContext(type = PersistenceContextType.EXTENDED) private EntityManager em; .... @Out(scope = ScopeType.SESSION, required = false) private ConcurrentHashMap<B5, Boolean> selections = new ConcurrentHashMap<B5, Boolean>(); ..... @Factory("b5List") public void findAll() { // here selections is emtpy when moving from one page to the other } public String select() { // here selections is ok ! }