Asynchronous JavaScript XML (Ajax) is considered for a long time as a luxury, either users or developers, but today Ajax is essential for building compelling and competitive applications. JSF 2.0 has built-in Ajax support, with a standard JavaScript library. JSF Ajax requests partially process components on the server, and partially render components on the client …
JSF 2
JSF 2 Custom Tags Example
You’ve already seen how to lay out user interface elements with templates. In addition, facelets allows you to define a custom tags. A custom tag looks like a regular JSF tag, but it uses the facelets composition mechanism to insert content into your page. Implementing a custom Facelets tags with jsf2.0 is a two step: Implement …
JSF 2 UI Decorate Example
Unlike the ui:composition, the ui:decorate is more content-centric approach, in that you write your pages as usual, but you surround the contents with ui:decorate tag that has a template attribute. The decorator in its turn uses the provided template for decorating the contents that written as you’ve determined in the template. Using of ui:decorate is vary differ from the …
JSF 2 Template – Composition, Insert and Define Example
Most web applications follow a similar pattern, in which all pages have a common layout and styling. It is typical for pages to have the same header, footer and sidebars. Facelets lets you encapsulate that commonality in a template, so that you can update the look of your site by making changes to the template, not …
JSF 2 Message and Messages Example
The <h:message/> and <h:messages/> can be used for displaying the error, fatal error, warning and information messages for single component and for the whole current view respectively. When it comes to develop a JSF page, it happens for a component/view to have a messages that tell the user about some missing or wrong data must be …
JSF 2 Resource Bundle Example
When you implement a web application, it’s good idea to collect message strings in a central location. This process makes it easier to keep messages consistent and, crucially, makes it easier to localize your application for other locales. The messages strings are collected in a file(s) in the properties format, and those files must use …
JSF 2 Form Example
Most of web applications run on a form submission, and JSF 2 applications are not exception. The <h:form/> is the component that’s responsible for allowing the <h:commandButton/> and <h:commandLink/> to submit the view back to the server. The content type that’s used for submission is by default application/x-www-form-urlencoded, once you’ve omitted providing the attribute enctype. Those values that …
JSF 2 PanelGrid and PanelGroup Example
The components <h:panelGrid/> & <h:panelGroup/> are mainly used as an alternative option for laying out the components into a certain form by generating the HTML markup for laying out components in rows and columns. At the other side, <h:panelGrid/> is often used in conjunction with <h:panelGroup/>, which groups two or more components so they are treated as one. …