Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Lifecycle misses RESTORE_VIEW  RSS feed

 
Uwe Lindenberg
Ranch Hand
Posts: 44
2
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello dear readers,

i imlemented the following (please see below for details)
a) EinzelseitePhasenListener implements PhaseListener with beforePhase, afterPhase and getPhaseId
b) ManagedBeanPhasenJSFRequest which is a simple Named-Bean
c) a xhtml-File for starting the lifecycle and containing f:phaseListener type="utils.EinzelseitePhasenListener"
d) EinfachHelferklasse is class for formated output, not complex and not worth to mention.

I wonder when RESTORE_VIEW will occour. I mean when "Beginn des Lebenszyklus" will be printed use it this way? Using it via faces-config
<lifecycle>
<phase-listener>utils.EinzelseitePhasenListener"</phase-listener>
</lifecycle>
is running fine.






Thanks in advance,

Uwe
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://docs.oracle.com/javaee/1.4/tutorial/doc/JSFIntro10.html#wp122219
 
Uwe Lindenberg
Ranch Hand
Posts: 44
2
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

thank you very much for your reply and the link. My problem is not the phase RESTORE_VIEW or the lifecycle, but when it occurs:

1. Declaring a phase listener in faces-config.xml works fine and "Beginn des Lebenszyklus" is printed.
2. Using f:phaseListener in the xhtml doesn't work. "Beginn des Lebenszyklus" is not printed.

In both cases all other phases are active at their expected point of time.

Why is their a difference concerning 1. and 2. ?

I tried Wildfly and Tomcat.

Thanks in advance,

Uwe
 
Uwe Lindenberg
Ranch Hand
Posts: 44
2
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea?

Thanks in advance,

Use
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you define a phase listener in the View Template (xhtml), obviously it cannot be invoked until that particular View Template has been selected and digested so that JSF can tell that it should hook in that particular listener.

So it wouldn't be possible to capture lifecycle events from before that time.
 
Uwe Lindenberg
Ranch Hand
Posts: 44
2
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

thanks you very much for your advice.

Best regards,

Uwe
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!