tailieunhanh - Mastering JavaServer™ Face phần 5

UIPanel được sử dụng để quản lý bố cục của phần còn lại của các thành phần. Các trẻ em của bảng điều khiển được sắp xếp trong một mạng lưới rộng hai cột và nhiều hàng khi cần thiết để nhường chỗ cho tất cả các thành phần con. Nói cách khác, | 170 Chapter 5 The UlPanel is used to manage the layout of the rest of the components. The children of the panel are arranged in a grid two columns wide and as many rows as needed to make room for all the child components. In other words since the columns attribute is set for this panel two components at a time will be placed into a row then a new row will be created for the next two until there are no more child components. The grid Renderer creates an HTML table element for the UlPanel component. The panel renders its children so that it can manage the layout by rendering the components inside the rows and cells of the table. Here is the code for the opening of the panelGrid tag from Listing for quick reference. h panelGrid id registrationPanel columns 2 rowClasses centered footerClass centered border 1 The rowClasses attribute specifies the CSS classes to apply to each row. The Renderer will apply the value specified in this attribute to every row in the table. If you d like to alternate colors or some other aspect of the row you can comma-delimit the different CSS classes in this attribute. For example if you wanted every other row to have a gray background you could specify the value of rowClasses like this h panelGrid id registrationPanel columns 2 rowClasses centered grayCentered footerClass grayCentered border 1 The table will be rendered with every other row having its class set to grayCentered. Figure shows the page rendered with every other row in gray. Figure Row class example. JSP Integration in JSF 171 The next block of code from Listing creates the UlOutput and UlInput components that allow the users to enter their information for registration. There are four UIOutput components that make up the labels and four UIIn-put components that make up the text fields. Let s look in detail at the password entry label and text field component pair to get a better understanding of how these tags work. Here is the code for the components h .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.