Using Single Submit

You are viewing an old version (v. 2) of this page.
The latest version is v. 18, last edited on Mar 16, 2011 (view differences | )
<< View previous version | view page history | view next version >>

Using Single Submit Tutorial

JSF 2.0 added the <f:ajax> tag that was very useful for creating the rich, interactive forms that users expect to see in a modern web application. ICEfaces 2.0 leverages and improves this new functionality with the <icecore:singleSubmit> tag. Single Submit is a replacement for the partialSubmit attribute common on ICEfaces 1.8.x applications. By using Single Submit we can send only some of the fields in a form to the server for processing, which can be handy as we can dynamically modify the form based on what was sent. For example in-line validation can be fired, different fields can be rendered depending on what the user has selected, and so on.

This tutorial will deal with using the <icecore:singleSubmit> tag in a simple form page. This tutorial assumes the reader has an understanding of JSF and ICEfaces and creating and working with projects related to those technologies. The focus is not to teach those basics, but instead to use Single Submit.

The goal of this tutorial is to create a basic ICEfaces 2.0 project and add Single Submit. The example will be a single page form with a few input components to demonstrate how Single Submit works.

Development Tools Used

The following tools were used to create the project.

1. Make the singleSubmit Project

  • Using Eclipse create a new Dynamic Web Project called singleSubmit.
    • Target runtime: Apache Tomcat v7.0
    • Dynamic web module version: 3.0
    • Configuration: JavaServer Faces v2.0 Project (Mojarra)

2. Add ICEfaces

Add the icefaces.jar to your project from the ICEfaces 2 bundle. This can be added to the project through a custom User Library or by putting it into windowScope/WEB-INF/lib/. The approach doesn't matter as long as the jar is included in the deployed war file.

3. Create form.xhtml

Create a new page called form.xhtml and paste the code below:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2017 ICEsoft Technologies Canada Corp.