-
1. Re: how to prevent page changing in datascroller
ilya_shaikovsky Aug 3, 2007 4:55 AM (in response to kuikui)just set ajaxSingle="false" on your dataScroller component and all the components in the same region will be also processed while pages changing. So validation for the table will be used while switching.
-
2. Re: how to prevent page changing in datascroller
kuikui Aug 5, 2007 8:41 PM (in response to kuikui)Thanks for your help, but what I really want to know is how can I STOP the page changing... the scenario is:
page 1 -> change something on page 1 -> click page 3 -> display error message saying that the change made on page 1 is wrong -> stay at page 1 (which means NOT going to page 3)
The way you suggested me can perform validation but the page will still move to page 3 and I really want to find a way for the datascroller NOT changing page even people click on other page number. -
3. Re: how to prevent page changing in datascroller
ilya_shaikovsky Aug 6, 2007 3:23 AM (in response to kuikui)So. I'm using
<h:form> <rich:messages/> <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5"> <rich:column> <h:inputText value="#{cap.name}" required="true"/> </rich:column> <f:facet name="footer"> <rich:datascroller pageIndexVar="pageIndex" pagesVar="pages" ajaxSingle="false"> </rich:datascroller> </f:facet> </rich:dataTable> </h:form>
So in this simlpe case - if I din't fill the form - pages will not be switched for me. Did you mean something like this? -
4. Re: how to prevent page changing in datascroller
kuikui Aug 9, 2007 2:01 AM (in response to kuikui)Thanks a lot and sorry for the late reply... Your solution is quite similar to what I am asking but there's still something different from my situation.
Currently I am using Javascript to validate the inputs in the dataTable, and I would like to alert an error message and using javascript to stop the datascroller changing the page.
I tried putting ajaxSingle="false" and onclick attribute in the rich:datascroller but the page will still changing to other page once the user clicks on other page number.
Do you have any other suggestions which can allow me to accomplish this with Javascript involved? Thanks again for your help. -
5. Re: how to prevent page changing in datascroller
ilya_shaikovsky Aug 9, 2007 5:11 AM (in response to kuikui)ok... I've used server validation, and you - client one..
To acomplish this for this simple example you may look again on my example and add your validation JS to parent form onsubmit attribute.