Questions tagged [prerenderview]

preRenderView is a JSF specific event which is triggered right before the render response phase

<f:event type="preRenderView"> is a JSF specific event which is triggered right before the render response phase.

It enables developers to attach listener methods which run right before the first bit to the HTTP response is been written, so that any necessary preprocessing could be performed which may be significant for the shape and the state of the response (e.g. preloading some presentation data or even a redirect).

It's often been used in combination with <f:viewParam> as workaround to trigger GET actions based on view parameters, because no suitable "GET action listener" tag exists in JSF 2.0/2.1. This is in JSF 2.2 solved by the new <f:viewAction> tag.

22 questions
101
votes
2 answers

When to use f:viewAction / preRenderView versus PostConstruct?

When should one use the f:viewAction or preRenderView event to initialize data for a page versus using the @PostConstruct annotation? Is the rationale to use one or the other based on the type of scope of the backing bean e.g. If the backing bean is…
BestPractices
  • 12,738
  • 29
  • 96
  • 140
15
votes
1 answer

When to use preRenderView versus viewAction?

When should one use the preRenderView event to initialize data for a page versus using the viewAction? Are they equal in use and do they have the same effect? preRenderView Event
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
6
votes
2 answers

How to perform navigation in preRenderView listener method

I'm starting from What can , and be used for? I have a pre render view event listener: which invokes…
user1594895
  • 587
  • 1
  • 10
  • 31
6
votes
2 answers

PreRenderView incrementally called on every postback

I have an issue with the order and number of executions of an f:event type="preRenderView". During my search here I found as usual answers from BalusC in this and this post related to my problem - still it leaves two questions for me: When I put…
Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96
4
votes
1 answer

preRenderView is called on every ajax request

I am implementing infinite scrolling using jquery waypoints and jsf following link . I have prerender for one of the xhtml on which infinite scrolling is required . Now, as waypoint sends ajax request so why for every scroll it is calling prerender…
Rahul Singh
  • 781
  • 11
  • 27
3
votes
1 answer

PreRenderView skipping button action after browser back

I have a search result page with a "Show more results" button. The backing bean is session-scoped and we use a preRenderView to execute the search method in the backing bean:
Simon
  • 1,605
  • 13
  • 22
2
votes
2 answers

URL redirection not working on preRenderView event

I finally got messages passed between pages, but this is not redirecting me to the user login page (../../index.xhtml) instead it shows the forbidden page : public String permission() throws IOException { FacesContext context =…
Chaibi Alaa
  • 1,346
  • 4
  • 25
  • 54
2
votes
1 answer

ui:include includes page before prerender event jsf

I have a test.xhtml page where I defines an event page also has a insert tag in it.
MAK
  • 575
  • 1
  • 10
  • 23
2
votes
1 answer

using redirect links with angularjs and prerender.io

What I mean by redirect links are links that internally redirect as soon as the app is opened. What page is captured by prerender.io ? The page before or after the redirect. Extra question: What triggers prerender.io to know that the page has fully…
coiso
  • 7,151
  • 12
  • 44
  • 63
1
vote
0 answers

JSF contains page with preRenderView event not trigger in

I am using JSF 2.0.1 and observe a difference when try to add header.xhtml onto other page with , the code example below: header.xhtml This page will be add as one component onto major page, it contains…
Lampard
  • 394
  • 7
  • 23
1
vote
0 answers

Filter - Error Rendering View[/Error.xhtml] java.lang.NullPointerException

I've the following context: a xhtml page, like this one:
LNRD.CLL
  • 385
  • 1
  • 5
  • 19
1
vote
1 answer

in template client not invoked

Following is my XHTML code. preRenderView event listener is getting ignored and my desired method is not getting called. I feel it is because of the templating used but can't figure out exact thing. please help XHTML:
mihir S
  • 617
  • 3
  • 8
  • 23
1
vote
1 answer

jsf dispatch in preRenderView error

in edit.xhtml I have In the backing bean public void onEditPageLoad() throws IOException { if (isNewRequest()) { if (callId…
bastiat
  • 1,799
  • 2
  • 19
  • 38
1
vote
0 answers

Clicking on commandLink is invoking preRenderView again

In my facelet, I have the below commandLink:
Sudipta Deb
  • 1,040
  • 3
  • 23
  • 43