dataSource
JSF component
project
tag attribute. It allows you to specify a JViews TGO project that will
be set to the underlying
IlpEquipment
on the server side. For more information, see Loading a project file . Keep in mind that
not all CSS view customizations are supported by the equipment JSF
component For details, see Equipment view component services .
equipmentView
JSF component
width
and
height
) using the
style
tag attribute:
<jvtf:equipmentView id="myEquipment" context="#{contextBean}" style="width:740;height:550" project="data/myProject.itpr" />
<installdir>
stands for the directory where Rogue Wave JViews TGO is
installed.
id
tag attribute defines a unique identifier for the
equipmentView
component. The
context
tag attribute is a binding to a bean defined in the
faces_config.xml
file. The
style
tag attribute defines two CSS properties (
width
and
height
) for the dimensions, in pixels, of the equipment component. The
project
tag attribute is a relative path to a JViews TGO project within
the web application. This file should be accessible by the web
application.
context
bean in the
faces_config.xml
file:
<managed-bean> <managed-bean-name>contextBean</managed-bean-name> <managed-bean-class> ilog.tgo.faces.service.IltFacesDefaultContext </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean>
dataSource
JSF component for the equipment view
<jvtf:dataSource id="myDataSource" value="#{dataSourceBean}" />
id
tag attribute defines a unique identifier for the data source
component. The
value
tag attribute gets a value binding to a bean previously declared
in the
faces_config.xml
file that extends
IlpAbstractDataSource
.
dataSource
JSF component to the
equipmentView
JSF component
<jvtf:equipmentView id="myEquipment" context="#{contextBean}" style="width:740;height:550" dataSourceId="myDataSource" />
dataSourceId
tag attribute gets the unique identifier of the data source
component that will connect it to the equipment view.
dataSource
bean in the
faces_config.xml
file:
<managed-bean> <managed-bean-name>dataSourceBean</managed-bean-name> <managed-bean-class>ilog.cpl.datasource.IlpDefaultDataSource</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>context</property-name> <property-class>ilog.cpl.service.IlpContext</property-class> <value>#{contextBean}</value> </managed-property> <managed-property> <property-name>fileName</property-name> <property-class>java.lang.String</property-class> <value>data/myEquipment.xml</value> </managed-property> </managed-bean>
dataSource
bean is declared and two properties are set:
context
and
fileName
. The
context
property is set with a value binding to a context bean. It is
mandatory, so that the JViews
TGO context is consistent across components. The
fileName
property gets a relative path to an XML file compatible with the
data source and accessible from the web application.
<installdir>
stands for the directory where Rogue Wave JViews TGO is
installed.
equipmentView
JSF component
<jvtf:equipmentView id="myEquipment" context="#{contextBean}" style="width:740;height:550" dataSource="#{dataSourceBean}" />
dataSource
tag attribute gets a value binding to a bean that extends
IlpAbstractDataSource
. It will connect the equipment component to this data source
bean.
equipmentView
JSF component
data
tag attribute, which can be used to connect business data sources
using:
project file
IlpAbstractDataSource
data
dataSourceId
dataSource
project
data
tag attribute behaves exactly like the
project
attribute, getting the relative path to a JViews TGO project, as in
the following example:
<jvtf:equipmentView id="myEquipment" context="#{myContext}" style="width:740;height:550" data="data/myProject.itpr" />
myProject.itpr
is the project file within the web application.
data
tag attribute behaves exactly like the
dataSourceId
attribute, getting the unique identifier of a data source
component, as in the following example:
<jvtf:equipmentView id="myEquipment" context="#{myContext}" style="width:740;height:550" data="myDataSource" />
myDataSource
uniquely identifies a data source JSF component in the current
session.
data
tag attribute behaves exactly like the
dataSource
attribute, getting a value binding to a bean that extends
IlpAbstractDataSource
, as in the following example:
<jvtf:equipmentView id="myEquipment" context="#{myContext}" style="width:740;height:550" data="#{dataSourceBean}" />
#{dataSourceBean}
is a value binding to the corresponding bean declared in the
faces_config.xml
file.
equipmentView
JSF component
binding
attribute can be set with a value binding to a backing bean that
extends
IltFacesDHTMLEquipmentView
(the JavaScript implementation of the equipment view JSF
component). The following example illustrates this:
<jvtf:equipmentView id="myEquipment" context="#{contextBean}" style="width:740;height:550" binding="#{myJSFEquipment}" />
#{myJSFEquipment}
is a value binding to a backing bean declared in the
faces_config.xml
like this:
<managed-bean> <description>A bean extending IltFacesDHTMLEquipmentView</description> <managed-bean-name>myJSFEquipment</managed-bean-name> <managed-bean-class>example.MyEquipmentView</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean>
<installdir>
stands for the directory where Rogue Wave JViews TGO is
installed.
equipmentView
JSF component
equipment
attribute of the equipment view JSF component, as follows:
<jvtf:equipmentView id="myEquipment" context="#{contextBean}" width="740" height="550" equipment="#{myIlpEquipment.equipment}" />
width
and
height
are used to specify the size of the equipment view. Other
examples produce the same results using the
style
tag attribute with the CSS properties "
width
" and "
height
".
equipment
attribute is set with a method that binds to a bean defined in
the
faces_config.xml
. The corresponding method (
getEquipment
in this case) will be invoked when the JSP page is parsed. It
allows the user to have access to the
IlpEquipment
API as well as to its instantiation. Using the
equipment
attribute and keeping the
IlpEquipment
in a bean is a good way to provide quick access to the underlying
IlpEquipment
API within the web application. Note that the context is not
passed to the
myIlpEquipment.getEquipment
method, which means that this bean must be configured with the
appropriate context in the
faces_config.xml
file. For example:
<managed-bean> <description>A bean with read access to the 'equipment' property </description> <managed-bean-name>myIlpEquipment</managed-bean-name> <managed-bean-class>example.MyEquipment</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>context</property-name> <property-class>ilog.cpl.service.IlpContext</property-class> <value>#{contextBean}</value> </managed-property> </managed-bean>
<installdir>
stands for the directory where Rogue Wave JViews TGO is
installed.