From the course: Java EE: JavaServer Faces JSF

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Basic Ajax in JSF

Basic Ajax in JSF

From the course: Java EE: JavaServer Faces JSF

Start my 1-month free trial

Basic Ajax in JSF

- [Instructor] Let's go back to our welcome page and at Ajax supports to the components. For the uninitiated, we're going to demonstrate the magic that Ajax brings to the table. Submitting this page triggers a full page refresh. And we see the updated data in the output text component. Being able to execute page actions with command components selectively process input components and update output components with new data, all without fully refreshing the page is why Ajax is such a necessary tool in any web developer's toolkit. So, what's the easiest way we can Ajax this up? It's really straightforward. We first make sure that prependId is set to False in our h:form on line 14, then we just enclose all the components we need to Ajaxify in the f:Ajax tag. So we want to wrap all of this, f:ajax, open and close tags. Let's format that. And Save. Then we need to set two attributes for the f:Ajax tag. First, we set the render attribute. Now, in the render attribute, we provide a list of…

Contents