-
1. Re: dataScroller actionListener before
nbelaevski Feb 19, 2009 3:48 PM (in response to styx2000)Hello,
Do you have immediate="true" for rich:datascroller? -
2. Re: dataScroller actionListener before
styx2000 Feb 20, 2009 3:17 AM (in response to styx2000)no i dont.
this would skip the validation phase right? i want to have the form validated correctly, like when i press the save (=submit) button.
i tried it with immediate=true just to check, that doesnt work either (the backing bean object is not updated with the form value when the action method is called). -
3. Re: dataScroller actionListener before
nbelaevski Feb 20, 2009 10:04 AM (in response to styx2000)Ok, can you please add PhaseTracker to check if your code really executes before APPLY_REQUEST_VALUES phase?
-
4. Re: dataScroller actionListener before
styx2000 Feb 20, 2009 11:17 AM (in response to styx2000)my log file looks like this ( i also printed out the value of the bound object, it always has the old unchanged value)
[beforePhase] RESTORE_VIEW 1
Under ExceptionHandlerControl class BbMyBean$$EnhancerByCGLIB$$9e3aa992.setDataScroller
Under ExceptionHandlerControl class BbMyBean$$EnhancerByCGLIB$$9e3aa992.setUi_nationalinvoicename
[afterPhase] RESTORE_VIEW 1
[beforePhase] APPLY_REQUEST_VALUES 2
... action handler... value: "oldvalue"
... scroller listener .... value: "oldvalue"
[afterPhase] APPLY_REQUEST_VALUES 2
what does that tell me?
nationalinvoicename is the property i changed. ( there is something in the restore view phase) -
5. Re: dataScroller actionListener before
nbelaevski Feb 20, 2009 1:02 PM (in response to styx2000)Yes, now I'm sure that it's firing on the 2nd phase. What is RF version?
-
6. Re: dataScroller actionListener before
styx2000 Feb 23, 2009 3:42 AM (in response to styx2000)richfaces-impl-3.3.0.GA
jsf-impl-1.2_09 -
7. Re: dataScroller actionListener before
nbelaevski Feb 23, 2009 8:34 AM (in response to styx2000)I've just checked datascroller in 3.3.0.GA:
<h:form> <rich:dataTable id="dtrChfImediataList" var="item" value="#{forum5Bean.lotOfData}" rows="10"> <rich:column> <f:facet name="header"> <rich:datascroller actionListener="#{forum5Bean.listener}"/> </f:facet> #{item} </rich:column> </rich:dataTable> </h:form>
Listener fires on INVOKE_APPLICATION phase as it should be. Can you please post page code? -
8. Re: dataScroller actionListener before
styx2000 Feb 23, 2009 9:49 AM (in response to styx2000)thanks for looking into this.
<rich:dataTable id="frm_country_sr_tbl" value="#{BbCountrySearch.searchResults}" var="elem" rows="1" rowClasses="row1, row2" rowKeyVar="row" headerClass="cu-tableheader"> <rich:datascroller id="tblscroller" align="center" for="frm_country_sr_tbl" maxPages="6" fastControls="show" stepControls="hide" pageIndexVar="pageIndex" pagesVar="pages" reRender="eventsPageCount, recordCount, mainpanel" scrollerListener="#{BbCountrySearch.doScroll}" binding="#{BbCountrySearch.dataScroller}" actionListener="#{BbCountrySearch.doSavex}" /> ... </h:form>
-
9. Re: dataScroller actionListener before
nbelaevski Feb 23, 2009 10:44 AM (in response to styx2000)Do you redefine any data scroller attributes by binding?
-
10. Re: dataScroller actionListener before
styx2000 Feb 23, 2009 11:05 AM (in response to styx2000)no, i only use it to set it to the correct page when i open it:
this.dataScroller.setPage(this.searchResults.indexOf(this.selectedCountry) + 1);
-
11. Re: dataScroller actionListener before
nbelaevski Feb 23, 2009 2:29 PM (in response to styx2000)Sorry, but I still cannot reproduce the issue. Here is my page code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:c="http://java.sun.com/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> <html> <head></head> <body> <h:form> <rich:datascroller id="tblscroller" align="center" for="frm_country_sr_tbl" maxPages="6" fastControls="show" stepControls="hide" pageIndexVar="pageIndex" pagesVar="pages" reRender="eventsPageCount, recordCount, mainpanel" actionListener="#{forum5Bean.printDate}" /> <rich:dataTable id="frm_country_sr_tbl" value="#{forum5Bean.lotOfData}" var="item" rows="1" rowClasses="row1, row2" rowKeyVar="row" headerClass="cu-tableheader"> <rich:column> #{item} </rich:column> </rich:dataTable> </h:form> </body> </html> </ui:composition>
I guess some parent component is redefining scroller's "immediate" attribute. Can you please post full page code? -
12. Re: dataScroller actionListener before
styx2000 Feb 24, 2009 9:15 AM (in response to styx2000)i tried your example and it worked.
it seems like the problem was partly solved by cleaning the tomcat work-directory and restarting eclipse. i think the property immediate=true may have been set at some point and was still in the cache or something like that. sorry for that.
now the actionlistener method is invoked in the correct phase (INVOKE_APPLICATION 5), but the values are still not applied to the model. i can see them in the request, but the model-object is not updated. the setter method of the property is never called.
the form field is bound to BbCountrySearch.selectedCountry.invoicename
this is not correct jsf-behaviour, is it? (sorry, im still new to jsf)2009-02-24 14:17:45,169 [http-8080-9] DEBUG com.csc.cardupdate.common.CUSecurityFilter - Received Request: /administration/countryEdit.xhtml 2009-02-24 14:17:45,169 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [beforePhase] RESTORE_VIEW 1 2009-02-24 14:17:45,179 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.administration.BbCountrySearch$$EnhancerByCGLIB$$ac720995.setDataScroller 2009-02-24 14:17:45,179 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.administration.BbCountrySearch$$EnhancerByCGLIB$$ac720995.setUi_nationalinvoicename 2009-02-24 14:17:45,179 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [afterPhase] RESTORE_VIEW 1 2009-02-24 14:17:45,179 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [beforePhase] APPLY_REQUEST_VALUES 2 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.template.BbMessages$$EnhancerByCGLIB$$27a8aa0b.getMessages2 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.template.BbMessages$$EnhancerByCGLIB$$27a8aa0b.getFirstMessage 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.administration.BbCountrySearch$$EnhancerByCGLIB$$ac720995.getSearchResults 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [afterPhase] APPLY_REQUEST_VALUES 2 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [beforePhase] PROCESS_VALIDATIONS 3 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [afterPhase] PROCESS_VALIDATIONS 3 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [beforePhase] UPDATE_MODEL_VALUES 4 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [afterPhase] UPDATE_MODEL_VALUES 4 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [beforePhase] INVOKE_APPLICATION 5 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.administration.BbCountrySearch$$EnhancerByCGLIB$$ac720995.doSavex 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.administration.BbCountrySearch - [doSavex] start (action=doSavex) 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.administration.BbCountrySearch - [doSaveX] this.selectedCountry.getInvoicename(): +++ old value +++ 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.administration.BbCountrySearch - [doSave] start 2009-02-24 14:17:45,189 [http-8080-9] DEBUG com.csc.cardupdate.administration.BbCountrySearch - [doSave] this.selectedCountry.getInvoicename(): +++ old value +++ 2009-02-24 14:17:45,249 [http-8080-9] INFO com.csc.cardupdate.common.CUNavigationHandler - [handleNavigation] action:'null' outcome:'null' 2009-02-24 14:17:45,249 [http-8080-9] DEBUG com.csc.cardupdate.common.exceptions.JsfExeptionHandler - Under ExceptionHandlerControl class com.csc.cardupdate.administration.BbCountrySearch$$EnhancerByCGLIB$$ac720995.doScroll 2009-02-24 14:17:45,249 [http-8080-9] INFO com.csc.cardupdate.common.CUPerUserPoolDataSource - [getConnection] conn.class: class com.mchange.v2.c3p0.impl.NewProxyConnection 2009-02-24 14:17:45,279 [http-8080-9] DEBUG com.csc.cardupdate.administration.BbCountrySearch - [doScroll] start 2009-02-24 14:17:45,279 [http-8080-9] DEBUG com.csc.cardupdate.administration.BbCountrySearch - [doSroll] Andorra22xxx 2009-02-24 14:17:45,349 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [afterPhase] INVOKE_APPLICATION 5 2009-02-24 14:17:45,349 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [beforePhase] RENDER_RESPONSE 6 2009-02-24 14:17:45,870 [http-8080-9] DEBUG com.csc.cardupdate.common.CUPhaseListener - [afterPhase] RENDER_RESPONSE 6
-
13. Re: dataScroller actionListener before
nbelaevski Feb 24, 2009 9:46 AM (in response to styx2000)rich:datascroller is ajaxSingle="true" by default. Set ajaxSingle="false".
-
14. Re: dataScroller actionListener before
styx2000 Feb 24, 2009 9:52 AM (in response to styx2000)great, now it works!
thanks a lot!