In this video, learn about perfectly timed, conditionally executed managed bean code with ViewAction.
- [Man] Now let's try out the viewAction component.…Right here within the f:metadata tag on line 12,…we'll have viewAction.…Let's close the tag for now.…And save that.…Very good.…With the viewAction component, we get to execute…a method in our backing bean when the page is loaded,…or if we so chose, at any point…before the page is completey loaded, or thereafter.…
Let's see what that looks like.…For the viewAction component,…we define the action attribute,…which should point to a method on a backing bean.…We will use the welcomePage bean,…and on that bean we will scroll the sayHello method.…Let's save that.…What we've done here is to stipulate…that whenever this page is loaded,…execute the sayHello method.…
So with this page here, when we hit Enter in the browser,…we see that the parameter guests is passed with John…and the sayHello method is automatically executed…courtesy of the viewAction component.…Recall previously, would've had to click on…the Say Hello button to get that method executed.…A quick examination of the attributes available…
- Why use JSF?
- How JSF works
- Using managed beans in JSF
- Building a JSF page using Facelets
- Using Ajax support in JSF
- Processing complex data with JSF converters
- Security in JSF
- JSF and third-party component libraries
Skill Level Beginner
1. Web Application Development in JavaEE
2. Build Your First JSF Page
3. Use Managed Beans in JSF
4. Build a JSF Page Using Facelets
5. Use Ajax Support in JSF
6. Process Complex Data with JSF Converters
7. Protect Your Application with JSF Validation
8. Security in JSF
9. Combine JSF with Other Frameworks
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.