skip to main content
Charts > Programmer's documentation > Building Web Applications > Interoperability with third party Web technologies > Running JViews JSF applications in JSR 168 portlets
 
Running JViews JSF applications in JSR 168 portlets
NOTE See the Release Notes for supported JSF implementations and JSF Portlet bridge combinations.
If you want to use JViews JSF components in a JSR 168 portlet environment, you first need to check with your portal vendor whether JavaServer™ Faces components are supported.
Your Web application must be correctly configured. This section describes each of the steps required to make JViews JSF components compatible with portlets.
NOTE JViews JSF components are automatically switched to portlet mode if the classes of the portlet API are detected in the class path.
To avoid naming clashes between portlets, the JSR 168 specification requires content to be generated that is unique to each portlet. Therefore, the generated variables used by JViews JSF components must be prefixed by the portlet namespace.
Scripts prefixed by a namespace
Since JViews 8.1, the servlet filter IlvJSNamespaceFilter is no longer needed and must not be set on the controller servlet.
JavaScript variables prefixed by a namespace
In portlet mode, the generated JavaScript™ variables are prefixed by the portlet namespace. Thus, their usage in the JSP™ page is quite different.
In Rogue Wave® JViews a JavaScript action is built on a managed bean by using the static method encodeJavaScriptVariables of ilog.views.faces.IlvFacesUtil.
The parameter is the desired JavaScript action where the variables are declared with the ${id} notation. For example:
 
IlvFacesUtil.encodeJavaScriptVariables("${view}.setInteractor(${interactor})");
where view and interactor represent JavaScript variables.
The result of calling this method is the final JavaScript action with namespace-encoded variables.
The JViews JSF components that have JavaScript handlers need only to reference these bean properties.
The following code examples show a more complete use of JavaScript actions in the JSP page and the managed bean.
In JViews Charts
Using JavaScript actions in a JSP page
 
[...]
<jvcf:chartZoomInteractor id="zoom" [...] />
<jv:imageButton onclick="#{chartBean.setZoomAction}"/>
<jvcf:chartView id="chart" [...] />
[...]
Using JavaScript actions in a managed bean
 
public class ChartBean {
[...]
  private String setZoomAction;
  public ChartBean(){
    setZoomAction =
      IlvFacesUtil.encodeJavaScriptVariables("${chart}.setInteractor(${
        zoom})");
  }
  public String getSetZoomAction(){
    return setZoomAction;
  }
[...]
}
Declaring the image servlet
In portlet mode, the servlet used to render the image must be declared:
In JViews Charts
 
<jvcf chartView [...] servlet=
    "ilog.views.chart.faces.dhtml.servlet.IlvFacesChartServlet" />
Integrating JSF components into the portal
Depending on your portal implementation, integrating JSF components may require special configuration that is conditioned by the application server, the JSF implementation, the portlet-JSF bridge, and so on. Check with your portal vendor for what you need to do in this configuration step.

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