Documentation‎ > ‎

OpenFaces FAQ


General

OpenFaces is a JSF library that provides an extended set of advanced highly customizable JSF components, an Ajax framework and a validation framework. It extends the standard set of UI components with such sophisticated widgets as TreeTable, DataTable, DayTable, SuggestionField, DateChooser, Chart, and many others. Besides the components, OpenFaces has an Ajax framework and a validation framework. Ajax framework allows adding Ajax-based interaction to the pages where Ajax capabilities built into components are not enough, and Validation framework shifts the traditional JSF validation to the client side, provides new validators and a new kind of error presentation.

Roadmap

To learn when the next version of OpenFaces will come out and what new features or components will it have, see the OpenFaces Roadmap.


Quirks and Standards Compliance modes

The OpenFaces components were tested to work in both Quirks and Standards Compliance modes.

Licensing

I see that OpenFaces is dual licensed, can I use OpenFaces in a commercial project for free?

Yes you are welcome to use OpenFaces in commercial projects for free, like any other LGPL licensed libraries. The additional commercial license doesn't narrow the volume of OpenFaces users, but actually increases it, since it provides an additional way to use OpenFaces for companies that have a policy of not using open-source licensed software.


OpenFaces Licensing Models

OpenFaces is licensed under a dual license model. The functionality of the product is the same for both licensing options.

You can license OpenFaces binaries along with source code packages under the terms and conditions of a GNU LESSER GENERAL PUBLIC LICENSE (Version 2.1, February 1999).

Alternatively you can opt for a commercial license for OpenFaces under the terms and conditions of the Product License Agreement.

Open Source License Benefits

It is free of charge.

Open Source License Restrictions

This license does not restrict using OpenFaces in your proprietary software, though it has some peculiarities. As it follows from LGPL conditions, you may freely copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.

We do administer OpenFaces support community, but we cannot guarantee our feedback to all your posts.

Commercial License Benefits

The Commercial License exempts you from all the restrictions of the open-source license. This license is issued to a person or company and the license contains your name or the name of your company. Having once purchased the Commercial License you can perpetually use OpenFaces binaries in all your projects without any annual renewals, subscriptions or additional fees to us.

In addition to the license you'll receive a personal yearlong support via direct email with our Software Engineers and access to JIRA to track progress for your issues.

We guarantee our feedback to your support requests within 1 business day.

Commercial License Restrictions

Commercial License doesn't govern source code issues.


Support Policy

Free Support

Free support is provided via our support forum. It is constantly watched and administered by our support engineers, so we guarantee that none of your messages remains unnoticed. Though we do not guarantee that we will answer all the posts.

Paid Support

Commercial Support is provided via email, dedicated project in the Issue Tracking System, telephone, chats and remote access to the client’s computer. Feedback on your request is secured within 1 business day. 
OpenFaces Commercial Support is paid on the Time and Material basis. In case if you do not expect many issues with integrating our library, the Single-Developer Commercial Support Pack including 55 hours of work by our support engineers is available for purchase. It is active for one year or until all allocated hours are used-up, depending on what comes first. All holders of the OpenFaces Commercial Licenses get a Single-Developer Commercial Support Pack as a bonus to the license purchase. If you are interested in our Commercial Support or a Single-Developer Support Pack, please drop us a line at support@openfaces.org.

Project Infrastructure

OpenFaces web site

At OpenFaces web site you can find the detailed info about the project including demos, source codes, binaries and documentation, download the latest stable, nightly build or get the builds history. Refer to the readme.txt files in the respective packages for building instructions.

OpenFaces Community Site

The OpenFaces Community site contains all kinds of OpenFaces related resources such as release notes, roadmap, discussion forums, etc.


JIRA Issue Tracking System

If you want to submit a bug or request a feature, please use JIRA Issue Tracking System.

OpenFaces Git Repository

You can pull the entire OpenFaces project including the library itself, the tests and the demos from our Git repository. The current development version of the project is available at the following URL: git://github.com/openfaces/OpenFaces.git. This project can be built in three ways: using IntelliJ Idea IDE, Eclipse IDE, or Ant build tool. See the Building OpenFaces.html document in project's root directory for instructions.

Documentation

The OpenFaces developer's guide, the tag library documentation and the API reference are available online and are included in the OpenFaces binary distribution packages that can be found at the OpenFaces downloads page.

Forum

OpenFaces forum is available at the following address:
https://groups.google.com/a/teamdev.com/group/openfaces-forum/topics

Compatibility

Supported JSF implementations

OpenFaces was tested to work with the following JSF implementations:
  • Mojarra 1.2.x and Mojarra 2.0.3
  • Apache MyFaces 1.2.x

Supported application servers

OpenFaces was tested to work with the following application servers:
  • Apache Tomcat 6.0
  • IBM WebSphere 6.0 -6.1
  • Bea WebLogic 9.2
  • JBoss 4.0 - 6.0
  • Glassfish v3
  • Jetty 6.1.x

JSR-168 Portlets support

OpenFaces 2.x version family can be used to develop JSR-168 Portlets. It has been tested to work with the following portal servers:

  • JBoss Portal 2.4.x and 2.6.x

  • Liferay Portal 4.2.1

  • JetSpeed 2.0 Portal


Support for portlets in JSF 2.0 based OpenFaces 3.0 version has not been tested yet and it is waiting for the readiness of the appropriate Portlet 2.0 environment (servers and bridges).

IDE support

There is no support for visual tag editing in the current version of OpenFaces, though you can still use any JSF enabled IDE to edit page templates as text.

Compatibility with JBoss Seam

OpenFaces components are fully compatible with the JBoss Seam framework. The OpenFaces 2.0 components have been tested to work with JBoss Seam version 2.0 and 2.1.

Compatibility with RichFaces

OpenFaces 2.0 library is fully compatible with JBoss RichFaces library version 3.3.1 including its components and Ajax framework. OpenFaces 3.0 is waiting for the readiness of JSF 2.0 enabled RichFaces 4, and doesn't have critical compatibility problems with the current RichFaces 4 Milestone 3.

Compatibility with PrimeFaces

OpenFaces and PrimeFaces can work in the same application, with no critical compatibility problems found upon general testing.

Compatibility with Tomahawk

OpenFaces and Tomahawk components can be used in the same application. However, there are some issues with some of the Tomahawk components. Most of the compatibility problems take place in cases when embedding Tomahawk components inside of OpenFaces components.

Compatibility with Trinidad

OpenFaces and Trinidad are not fully compatible yet. There are some issues when the OpenFaces and Trinidad components are used within one page.

Compatibility with ICEfaces

OpenFaces and ICEfaces components are not compatible currently.


Ajax

Some of the content disappears after performing an Ajax request

If some of the content of ajaxable OpenFaces components disappears after performing Ajax request, the reason might be that you use the <f:loadBundle> component within the OpenFaces Ajax-enabled components. The solution is to use the <o:loadBundle> component instead.


Showing Ajax progress message when Ajax4jsf/RichFaces request is in progress

When any OpenFaces Ajax request is in progress, the "Loading..." message appears in the upper-right corner of the screen. There is no possibility to display this message while Ajax4jsf's Ajax request is in progress. And there is no possibility to display the a4j:status component while an Ajax request in OpenFaces components is being executed. However, you can customize the Ajax progress message for the whole application by using the org.openfaces.ajaxMessageHTML application scope parameter in web.xml or for the particular page by using the<o:defaultProgressMessage> tag. For more details, please see the documentation.

Disabling OpenFaces Ajax progress message

There is no dedicated feature not to show OpenFaces Ajax progress message, however it is possible to utilize features of customizing its appearance for achieving this effect. The idea is to customize the progress message to be invisible using the "display: none" CSS declaration. You can either customize the Ajax progress message for the whole application by using the org.openfaces.ajaxMessageHTML application scope parameter in web.xml or for the particular page by using the <o:defaultProgressMessage> tag. For more details, please see the documentation.

Here's an example of disabling Ajax progress message using the <o:ajaxSettings> tag:


<o:ajaxSettings>
 <f:facet name="progressMessage">
<o:defaultProgressMessage style="display: none;"/>
 </f:facet>
</o:ajaxSettings>


DataTable and TreeTable

Number of filtered rows in the DataTable

You can get the total number of filtered rows using the getTotalRowCount() method of the DataTable component. You should use the component binding to be able to use this method from your backing bean.

Number of filtered rows in the TreeTable

At the present, there is no public API to get the total number of filtered rows for the TreeTable component. However, you can use the getRowCount() method. This method returns the number of rows that are actually loaded to the client. If you have the preloadedNodes attribute set to "all", the getRowCount() method will return the number of filtered rows.

Placing one DataTable/TreeTable into another one

There is a known issue that the DataTable and TreeTable components cannot be used inside DataTable, TreeTable or any other JSF components that replicate their child components during rendering. We are going to add support for such configurations in one of the future releases.

The row where an event occurs for the server-side event handlers

Server-side event handlers can be aware of the row where an event occurs by checking the request-scope variables that refer to the current row data object and current row index. See the appropriate documentation section. You can use the org.openfaces.util.Faces.var utility method if you need to retrieve a request-scope variable from a backing bean.

Duplicate component IDs exception

In some situations in Facelets application with Sun reference implementation 1.2, you can get the "duplicate component IDs" exception in the pages with the DataTable or TreeTable. This is actually not OpenFaces related problem and it can be reproduced in the application without OpenFaces at all. You can work around this problem by setting the id attributes for the all child components of the DataTable or TreeTable.

Using objects of different types to specify tree structure for the TreeTable component

You can specify the objects of different types for different TreeTable levels. First you should define a dynamic tree structure by specifying the <o:dynamicTreeStructure> tag and the nodeChildren attribute. The attribute should be specified as a value-binding expression, which is calculated for each node to retrieve the node's children. You can use the org.openfaces.util.Faces.var method to get the current node. Then you should return the node children depending on the current node type.

Expanding only one particular node programmatically

You can programmatically specify whether a particular node is collapsed or expanded with its nodeKey. To do so, you should do the following:

1. Bind the expansionState attribute of the TreeTable tag to the variable of org.openfaces.component.table.ExpansionState type in the backing bean.
2. Initialize this variable as follows:

private ExpansionState myTreeTableExpansionState =

         new DynamicNodeExpansionState(new AllNodesCollapsed());


3. Use the setNodeExpanded(TreePath keyPath, boolean expanded) method to specify whether the node is expanded or collapced. As the first parameter of the TreePath class, you should use nodeKey of the required node. The second parameter is the TreePath of its parent. For example:

myTreeTableExpansionState.setNodeExpanded(

         new TreePath("message10",null),true);


IMPORTANT: The "message10" value here is a "node key" object of the node that should be expanded, not the node object itself. The value of null means that it is a root node. Please also see the corresponding documentation section.

Another important note is that if you want to expand a node, for example from the third level, you should expand all its parent nodes as well. So you will need to make several setNodeExpanded method calls to expand nodes deep in a hierarchy of nodes.

Pagination in the TreeTable component

There is no built-in feature to add pagination to the TreeTable component. However, you can still implement similar behavior by implementing your backing bean to provide only the partial tree structure, and changing the provided data set when pressing "next" and "previous" buttons. To do so, you should display the "next" and "previous" buttons in one of the child nodes on the tree branch that you need to have the pagination functionality, for example in the last node of each tree branch. You can use the <o:row> and <o:cell> tags to do so (see the documentation). In thenodeChildren attribute you should provide only the required number of items for the current "page". When the user clicks the "next" or "previous" button, you should reload the TreeTable component by using O$.ajax.request JavaScript function (or the <o:ajax> component) and change the currently displayed page number so that your backing bean provide the new set of child nodes. See also the documentation for the O$.ajax.request function.

We are planning to implement a built-in TreeTable pagination feature in one of the future releases of OpenFaces.

Change the +/- icon in the TreeTable

To change the +/- expansion toggle displayed in TreeTable, use the expandedToggleImageUrl and collapsedToggleImageUrl attributes of the <o:treeTable> tag. You can see the example in the "Preloading Nodes" TreeTable demo. The source code of the OpenFaces demo is available at the Downloads page.


TabbedPane and TabSet

The difference between TabSet and TabbedPane

The TabbedPane component represents a set of pages for containing other components and a set of tabs for switching between these pages. Given the fact that the TabbedPane is a container, a developer can use different loading modes for loading the pages' content. For example, you can use Ajax to load the content of a TabbedPane page when it is selected for the first time.

The TabSet component is just a set of tabs that look like the ones located inside of the TabbedPane, but without any containers. So the TabSet can be used like a switch enabling a developer to manually adjust the page contents depending on a selected tab.

Different <h:form> components in different TabbedPane's tabs

The TabbedPane component should be included in the <h:form> component to save its state between page submissions. And it's incorrect to create nested <h:form> components. Therefore it's not possible to include <h:form> component as a child tag for every TabbedPane's tab in the current version of OpenFaces.


Miscellaneous

OpenFaces attribute completion in Eclipse IDE

It is possible to make OpenFaces attribute completion in Eclipse IDE by installing the Seam Tools plug-in from JBoss Tools.
See the following page to see how to install this plug-in : OpenFaces Attribute Completion in Eclipse IDE

Place OpenFaces components inside of the <h:form> tag

In order for OpenFaces components to work properly, they should be placed in the <h:form> or an analogous tag.

Be sure to use <h:head> instead of <head> in JSF 2.0 based applications

The <h:head> tag is required for proper rendering of OpenFaces resources such as default styles, so absence of <h:head> could lead to broken components' display.

Dynamic creation of the OpenFaces components from Java code

There are no specific requirements in the new JSF 2.0 based OpenFaces 3.0 version, but there's one thing that should be done in JSF 1.2 based OpenFaces 2.0 applications.


In general, the dynamic creation of the OpenFaces components from the Java code is the same as for the standard JSF components. However, there is the createSubComponents() method that should be called for the following components after the component is created and its properties are configured: FoldingPanel, TabbedPane, DropDownField, SuggestionField, TableColumn, TreeColumn. The typical creation of the OpenFaces components is shown in the following example:


FacesContext facesContext = FacesContext.getCurrentInstance();
Application application = facesContext.getApplication();
TabbedPane tabbedPane = (TabbedPane) application.createComponent(TabbedPane.COMPONENT_TYPE);
tabbedPane.setId("myTabbedPane");
tabbedPane.setStyleClass("tabbedPane");
...
tabbedPane.createSubComponents(facesContext);


Change the width of the DateChooser component

Currently, CSS width does not indeed affect the width of the DateChooser. The DateChooser was specifically designed to have the width equal to the pop-up Calendar's width.

However, you can declare the width for a DateChooser with the 'important' CSS modifier. For example:


<o:dateChooser style="width:70px!important;"></o:dateChooser>