4.4. Restrictions

The following restrictions apply to applications implementing the RichFaces framework:
  • Elements can not be appended on a page using RichFaces Ajax, but can be replaced. Elements that are rendered conditionally should not be targeted in the render attributes for Ajax controls. For successful updates, an element with the same identifier as that of the response must exist on the page. To work around this, include a placeholder (an empty element) during the initial creation of the page.
  • JSF 2 does not allow resources such as JavaScript or Cascading Style Sheets (CSS) to be added if the element requiring the resource is not initially present in the JSF tree. Components added to the tree with Ajax must have any required resources pre-loaded. In RichFaces, any components added to the JSF tree require components with corresponding resources included on the main page. To facilitate this, components can use the rendered="false" setting to not be rendered on the page.
  • JSF renders resource links (stylesheets, scripts) in order of occurrence. Adding <h:outputStylesheet> to the <h:head> section causes JSF to render it before the RichFaces resource links (dependencies of RichFaces components). To enable overwriting of RichFaces stylesheets and re-use RichFaces JavaScript implementation, render <h:outputStylesheet target="head"> to the <h:body> on the end of the section.
  • Switching RichFaces skins with Ajax during runtime can slow your system down, as this requires reloading all the stylesheets.