views:

624

answers:

2

Hi all,

I am developing a Seam-Jsfv1.2-EJB3 web app. I have a datatable and checkboxes in each row. Moreover, I have a datascroller at the bottom of my table as well.

My problem is when I click the next page number from the scroller, the selected checkboxes at the first page of the datatable is gone. I mean, even if they were selected, clicking the next page make them deselected. I see it by going back to the first page again by clicking the scroller.

Do you have any idea about that problem? In order to clearify my case, I attached my code below:

<rich:dataTable
            id="apiV2ProductList" rows="10" var="_apiV2Product"
            value="#{apiV2ProductList.resultList}"
            rendered="#{not empty apiV2ProductList.resultList}" reRender="ds">
            <rich:column>
                <f:facet name="header"> 
                    <h:selectBooleanCheckbox id="selectionCheckAll" onclick="selectAll()" /> 
                </f:facet>
                <h:selectBooleanCheckbox id="selectionCheck" onclick="increase(this)" value="#{_apiV2Product.selectValue}" >  
                </h:selectBooleanCheckbox>
            </rich:column>

...

<f:facet name="footer">
                <rich:datascroller id="ds" renderIfSinglePage="false">
                </rich:datascroller>
            </f:facet>

Many thanks in advance. Baris

+1  A: 

Adding an a4j support tag between scroller has solved my problem:

<f:facet name="footer">
                <rich:datascroller id="ds" renderIfSinglePage="false">
                    <a4j:support event="onpagechange"/> 
                </rich:datascroller>
            </f:facet>

However the other thing is, I am using JQuerry to style my table (ex. on mouse over and out), and this time, when I click the next page of my table, the style is gone...

Any help would be gratefull, many thanks in advance.

** PS: BTW the wierest thing to my mind is it comes me impossible to find a solution by yourself for this kind of problems. Your creation may not always be enough to solve (at least here in my example, adding a4j:support thing) I am asking experts, how can we handle that kind of things by ourselves... **

Bariscan
A: 

You don't need jQuery for styling the datatable

<rich:dataTable id="dataTable" var="x"  
onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
Gene De Lisa
Yep, it is right as well. Thanks for giving an alternative way of styling.
Bariscan