skip to main content
Diagrammer > Programmer's documentation > Building Web applications > Interoperability with third party Web technologies > Supporting Facelets and Trinidad
 
Supporting Facelets and Trinidad
If you want to use JViews Framework JSF components in a Facelets context, your Web application must be correctly configured.
Compatibility with Facelets and Trinidad
To make JViews Framework JSF components compatible with Facelets and Trinidad:
*Edit the configuration files.
To see examples of correct settings for Facelets with Trinidad, look at the faces-config.xml and web.xml files. If you want to use Facelets without Trinidad, look at faces-config-std.xml and web-std.xml instead.
*Develop XHTML-based pages according to the tag library documentation.
All attributes and all tags except the menu tags listed in Contextual menus are supported in Facelets.
If you are using custom tags, make sure you provide a custom.taglib.xml file that describes your custom library and declare its XML namespace in the page.
*Make sure that your .war files (or your server default libraries) include the necessary Facelets (and possibly Trinidad) jar files.
*Add Facelets support jars.
*If you want to run against JSF 1.1 or 1.2: classpath=jviews-jsf1-facelets-support.jar; jviews-xxx-all.jar; <JSF1.1 or JSF1.2 jars>
*If you want to run against JSF 2.0: classpath=jviews-jsf2-facelets-support.jar; jviews-xxx-all.jar; <JSF2.0 jars>
Code examples
For complete JViews Diagrammer application examples configured for use with Facelets or Trinidad, see <install-dir> /jviews-diagrammer90/codefragments/jsf-diagrammer-facelets/webpages/index.xhtml.
Contextual menus
In a facelets context, you can provide dynamic menus through the factory or factoryClass attribute of a contextual menu object.
<... contextualMenu ... factoryClass="mydemo.somepackage.MenuFactory" />
At the JViews Framework level, the contextual menu element is contextualMenu.
Static menu
You can use the value attribute of the contextual menu element to bind a static menu (running the code of the factory only once).
<... contextualMenu ... value="#{chartBean.menu}" />
In addition, you can use menu, menuItem, or menuSeparator tag components directly in the page:
 
<jvf:contextualMenu itemStyleClass="menuItem"
                    itemHighlightedStyleClass="menuItemHighlighted"
                    itemDisabledStyleClass="menuItemDisabled">
     <jv:menu>
          <jv:menuItem label="menuItem 1" onclick="alert('menuItem 1')" />
          <jv:menuItem label="menuItem 2" onclick="alert('menuItem 2')" />
          <jv:menuItem label="menuItem 3" onclick="alert('menuItem 3')" />
          <jv:menuSeparator />
          <jv:menu label="subMenu">
              <jv:menuItem label="subMenu Item 1"
                 onclick="alert('subMenu Item 1')" />
              <jv:menuItem label="subMenu Item 2"
                 onclick="alert('subMenu Item 2')" />
          </jv:menu>
      </jv:menu>
</jvf:contextualMenu>

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.