wood burning stoves 2.0*
The moose likes JSF and the fly likes Error on preRenderView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Error on preRenderView" Watch "Error on preRenderView" New topic
Author

Error on preRenderView

Mary Koh
Ranch Hand

Joined: Feb 19, 2012
Posts: 33
Hi,

I am scratching my head on this preRenderView. Please help me. I am moving to JSF 2.0 and I need a way to replace the hx:scriptcollector preRender.
When I access the page, the error is that it can't find the method in the onPageLoadBegin method in the managed bean.
Any pointers?

Old code






New code




Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

I've never had to use that feature, which was added to JSF2. However the JavaDocs for f:event say this about the event's listener method:

(signature must match public void listener(javax.faces.event.ComponentSystemEvent event) throws javax.faces.event.AbortProcessingException)


I would wager that your onPageLoadBegin method wasn't updated to take a ComponentSystemEvent as a parameter.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mary Koh
Ranch Hand

Joined: Feb 19, 2012
Posts: 33
Hi,

Is there any suggestion that you could you recommend on how should I moved the hx:scriptcollector preRender to JSF 2.0?

I tried to used back the old codes, but I am getting the below error. Any advise?





Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Your method signature does not match the specification.
Mary Koh
Ranch Hand

Joined: Feb 19, 2012
Posts: 33
Hi,

What should it be instead?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19


(signature must match public void listener(javax.faces.event.ComponentSystemEvent event) throws javax.faces.event.AbortProcessingException)
Mary Koh
Ranch Hand

Joined: Feb 19, 2012
Posts: 33
Hi,

I still encounters error after I changed the signature.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

The stack trace seems to indicate that you changed your view definition and that it's referencing the method via the EL expression "#{pagecode.Login.onPageLoadBegin2}".

Mary Koh
Ranch Hand

Joined: Feb 19, 2012
Posts: 33
Hi,

What does that means? I would like to understand more.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error on preRenderView
 
Similar Threads
Call a method when I go to another page JSF
redirect
duplicate call on preRenderView event
onInit() and redirect
confusion about <f:metaData> tag