The functioning of both tags is very similar, both need a definition for trigger mechanism(when to invoke method) and action mechanism(which method to invoke). These tags are defined in in the meta definition section of the page as follows
<f:viewAction>
This action component specifies an application-specific command (or action), using an EL method expression, to be invoked during one of the JSF lifecycle phases,<f:metadata>
<f:viewAction phase="PROCESS_VALIDATIONS" action="#{person.init()}"/>
</f:metadata>
The attributes "action" and "phase" define which method to invoke for an event.
action: EL method expression i.e. method to invoke. e.g.#{person.init()}
phase: Name of the event for which to install a listener.
The above tag will result in person.init() method invoked before the "Process Validation" JSF lifecycle phase.
The init method (in the "Person" BackingBean) can be as follows:
public String init() {
// do something like get List of persons from database
}
The "phase" attribute can have one of the possible values.
- APPLY_REQUEST_VALUES
- PROCESS_VALIDATIONS
- UPDATE_MODEL_VALUES
- INVOKE_APPLICATION
The default is INVOKE_APPLICATION.
<f:event>
This specifies an application-specific action, using an EL method expression, to be invoked during one of the JSF lifecycle phases.<f:metadata>
<f:event type="preRenderView" listener="#{person.init()}"/>
</f:metadata>
The attributes "listener" and "type" of <f:event> define which method to invoke for an event.
listener: EL method expression i.e. method to invoke. e.g.#{person.init()}
type: Name of the event for which to install a listener.
As a result of the above <f:event> declaration, JSF run-time invokes person.init() prior to rendering the components.
The init method (in the "Person" BackingBean) is shown as follows:
The init method (in the "Person" BackingBean) is shown as follows:
public void init() {
// do something like get List of persons from database
}The "type" attribute can have one of the possible values.
- preRenderComponent
- preRenderView
- postAddToView
- preValidate
- postValidate
<f:viewAction> differs from <f:event> in the following manner
- View actions, by default is not invoked in post-backs; where as in f: event, post-backs needs to be programmatically checked.
- View actions have navigation capabilities, View actions support both implicit and explicit navigation. (action method returns backs a view or in xml), where as in f:event one needs to manage navigation programmatically using response.sendRedirect or using NavigationHandler
- View actions can be triggered early on, before a full component tree is built, resulting in a lighter weight call.
This comment has been removed by the author.
ReplyDeleteNice Article. We are authorised support partner in Quickbooks Payroll. If you required any help for Quickbooks Payroll Support Phone Number 1-800-986-4607 if you are Expand your business to a new hike, with progressive approach. Seeking for the best accounting software? Then, get quickbooks installed in your system. The software proves to be more profitable to the business
ReplyDeleteThe difference between each stage is very important, click here for more info about the qualities of the reworder so you should definitely understand at what stage and how you can use this data.
ReplyDeleteVery nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
ReplyDeleteSelenium online training
Selenium certification training
Selenium online course
Selenium training course
This article is truly essential and detailed, since I was able to get what I wanted to! Appreciate your shared educational lecture!
ReplyDeleteWe have a panel of QuickBooks Proadvisor Support Phone Number experts who can help you to solve your QuickBooks related issues. The solutions we deliver will take only few seconds of you. We have the availability 365 days a year and 24 hours a day!
ReplyDeleteResurge is absolutely 100% natural, safe and effective. Many thousands of folks enjoy taking Resurge every day and there has been absolutely zero side effects reported. Every capsule of Resurge is manufactured here in the USA in our state of the art FDA approved and GMP (good manufacturing practices) certified facility under the most sterile, strict and precise standards. Resurge is 100% all natural, vegetarian and non-GMO. As always, if you have a medical condition it's recommended to consult with your doctor. Best natural foods for weight loss
ReplyDelete"Nice post! Thanks for sharing valuable article.
ReplyDeletePlease Visit our Website supply chain
Incoterms"
What an extremely wonderful post this is. Genuinely, perhaps the best post I've at any point seen to find in as long as I can remember. Goodness, simply keep it up.
ReplyDelete360DigiTMG
ReplyDeleteSomebody Sometimes with visits your blog normally and prescribed it as far as I can tell to peruse too.
hrdf claimable
I think I have never watched such online diaries ever that has absolute things with all nuances which I need. So thoughtfully update this ever for us.
ReplyDelete360DigiTMG data science malaysia
incredible article!! sharing these kind of articles is the decent one and I trust you will share an article on information science.By giving an organization like 360DigiTMG.it is one the best foundation for doing guaranteed courses
ReplyDeletedata science course noida
Very informative post ! There is a lot of information here that can help any business get started with a successful social networking campaign !
ReplyDeleteData Science Training in Hyderabad
Who Should Undergo Fut Hair Transplantation
ReplyDeleteSuperb exertion to make this blog more awesome and appealing.
HVAC & Plumbing Services
ReplyDeleteAir Star Heating guarantees reliability and quality for all equipment and services.
Air Star Heating specialists always try to deliver the most excellent quality of services to our customers at an affordable price. It is understood that every client has different needs and different problems. We try to accomplish the needs of every client according to their requests. We are having considerable experience in this field. Our specialists understand very well how things work. It doesn’t matter in which field of industry you are looking for services.
Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
Visit:- https://airstarheating.com
Nice...Excellent blog and useful to others
ReplyDeleteinternship for web development | internship in electrical engineering | mini project topics for it 3rd year | online internship with certificate | final year project for cse
Play the Best Slot Machines for Real Money - DrmCD
ReplyDeletePlay free casino slots for real money right 김천 출장마사지 here on DrmCD. Play 안동 출장안마 with best bonuses and free spins. Discover how to 울산광역 출장샵 win on slots, 과천 출장마사지 scratch cards, 문경 출장마사지
Having read your article. I appreciate you are taking the time and the effort for putting this useful information together.
ReplyDeleteB.C.A. Time Table 2022 - BCA 1st 2nd 3rd Ka Exam Routine
Cusat University Time Table 2022
Datta Meghe University Time Table 2022
JRRSU Exam Time Table 2022
Thank you so much for sharing such an amazing information with us. Visit for GeM Helpdesk Helpline, Tender Services, OEM Panel on GeM, and Tender Consultancy in Delhi NCR. Visit our website for more information in details.
ReplyDeleteGem Consultancy in Delhi NCR
salt likit
ReplyDeletesalt likit
dr mood likit
big boss likit
dl likit
dark likit
NRERP