20.04.2013 Views

Practical RichFaces, Second Edition

Practical RichFaces, Second Edition

Practical RichFaces, Second Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2 GETTING STARTED<br />

Listing 2-26. List any number of ids, each separated by a space<br />

<br />

<br />

<br />

When using , in addition to a space, it’s also possible to separate with a comma (,) as<br />

shown in Listing 2-27.<br />

Listing 2-27. Example of separating ids with a comma instead of just a space<br />

<br />

<br />

<br />

We believe using a comma is a little easier and more familiar for those who used with<br />

<strong>RichFaces</strong> 3, but it’s really up to you.<br />

The second difference is more important. Next, we’ll use an example to show how it works in JSF 2.<br />

Dynamic render<br />

To show how a dynamic render works in JSF 2, we’ll create a sample page to look like Figure 2-1.<br />

Figure 2-1. Dynamic render with three clocks<br />

Instead of hard coding the component to render, we are going to select which component we would<br />

like to update. Now, being able to set the render attribute to an EL is supported by JSF 2; however, it<br />

works slightly different when using <strong>RichFaces</strong>.<br />

Listing 2-28 shows the JSF page.<br />

Listing 2-28. Shows the JSF page<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!