Friday, September 21, 2012
Monday, September 10, 2012
JSF 2.1 Tip of the Day: Using <iframe /> Elements with PrimeFaces
Carousel and LightBox |
PrimeFaces offers a component called a Light Box (<p:lightBox />) which supports <iframe /> elements directly. You can see an example from the PrimeFaces showcase for how to use it.
I thought I would share a more interesting approach using a <p:caraousel /> object to display multiple <iframe /> elements in a more "sexy" approach.
The cool thing is that the code is really easy to implement!
The code was developed using NetBeans 7.2 and Apache Maven. The code can be downloaded here: iframe-example.zip
code
Sunday, September 09, 2012
JSF 2.1 Tip of the Day: Progressive Update, or Graceful Degradation with <f:ajax/>
The design is generally called progressive enhancement. This means that the application will work with basic components, but its functionality is further enhanced using JavaScript and CSS. The same side of the coin is also called graceful degradation. To follow the designs, you must take advantage of the component semantics, for example
alt
attribute on <img /> tag.The code below shows you two different ways to use <f:ajax /> to enhance a standard <h:selectBooleanCheckbox />. The second example is not as common. There is also a <h:commandButton /> which can be used just in case JavaScript is disabled.
A best practice when considering your design is to make sure that the form will perform the expected behavior prior to adding AJAX. Once the AJAX is enabled, check to make sure that the behavior is still as expected.
Code
Saturday, September 08, 2012
JSF 2.1 Tip of the Day: Using <f:ajax/> to Update Element Outside A Form
A JSF forum question was asked on how to update a JSF element outside of a <h:form/> element. This is one solution using <f:ajax/>.
Example
JSF Tip of the Day: JavaScript Execute a Button Once
I saw this question on a NetBeans forum from a new developer.
"How do you disable a button on a page after one click?"I figured since I was going to answer the question anyway, I would publish a quick example of one way to do it.
JSF 2.1 Tip of the Day: PrimeFaces 3.4 Advanced Table Example with JPA
PrimeFaces 3.4 Data Table |
The example was developed using Maven on NetBeans 7.2. The source code can be downloaded from here: advanced-table.zip.
Index.xhtml
Subscribe to:
Posts
(
Atom
)
Popular Posts
-
Introduction This article is not another diatribe to tell you the importance of unit testing. I think we can all agree that it is important...
-
A friend of mine asked me if there was a list of reserved words in EL and JSF. He had previously looked for it, and after some Google search...
-
I saw a question posed on stackoverflow called Trouble with Primefaces 3.0.M2 SelectOneMenu Ajax behavior and I had just done an example a...
-
I was working on a couple of SSL based issues when I made a couple of observations. The default self-signed key generation in Java does not ...
-
This is an example on how to make a system call to the local operating system to execute external programs. This example was written to work...
-
We have been doing a lot of work lately with PrimeFaces. A common set of questions comes up about displaying <p:dialog/> boxes on a pa...
-
I was asked earlier today how to reset fields in a JSF application, if the validation fails. In his case, he had a Richfaces table which had...
-
Image by quasarkitten via Flickr The basics for creating a Maven archetype can be found in the Maven - Guide to Creating Archetypes . The ...
-
Previously, I posted an example of how to use JSF 1.2 with form based authentication (j_security_check). In this example, I use JSF 2.x to...
-
Abstract A common use case is to iterate over a collection of elements, and display them on a page. In the world of JSP, we would use a Ja...