我想使用HtmlDataTable的navigateToRow()和findRow()方法从数据表中选择一个特定的行。我按照这个链接 http://component-showcase.icesoft.org/component-showcase/showcase.iface ==>表格==>查找行选项。我正在将数据表绑定到辅助bean。我得到以下错误“方法findRow(String,String [],int,String,boolean)未定义类型HtmlDataTable”在我使用findRow()和navigateToRow()方法的行。如何解决这个错误。
这是我的jspx页面
<?xml version="1.0" encoding="utf-8" ?>
<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<jsp:directive.page contentType="text/html;charset=utf-8" />
<f:view>
<ice:loadBundle basename="com.unvired.ump.resources.Messages"
var="msgs"></ice:loadBundle>
<ice:outputDeclaration doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
<html>
<head>
<title><ice:outputText value="#{styleBean.style}" escape="false" />
<ice:outputStyle href="./css/master_css.css" /><ice:outputStyle
href="./css/rime.css" /> <ice:outputStyle href="./css/selection.css" />
</title>
</head>
<body>
<ice:form id="ADMIN_COCKPIT_FORM">
<ice:panelTabSet id="heartBeatTab"
selectedIndex="#{heartBeatHandler.focusIndex}" tabPlacement="Top"
tabChangeListener="#{heartBeatHandler.processTabChange}">
<ice:panelTab rendered="true" label="#{msgs['heartBeat.syst_info']}"
icon="images/menu/recent.gif">
<!-- Refresh entire page -->
<ice:panelGroup styleClass="exampleBox dataScrollingContainer">
<h:panelGrid columns="2">
<h:outputText value="Search Query:" />
<h:inputText value="#{sampleRowSelector.searchQuery}" />
<h:outputText value="Case Sensitive:" />
<h:selectBooleanCheckbox value="#{sampleRowSelector.caseSensitive}" />
<h:outputText value="Columns To Search:" />
<h:selectManyCheckbox value="#{sampleRowSelector.selectedColumns}">
<f:selectItems value="#{sampleRowSelector.COLUMNS}" />
</h:selectManyCheckbox>
<h:outputText value="Search Type:" />
<h:selectOneRadio value="#{sampleRowSelector.selectedSearchMode}">
<f:selectItems value="#{sampleRowSelector.SEARCH_MODES}" />
</h:selectOneRadio>
<h:outputText value="Effect To Use:" />
<h:selectOneRadio value="#{sampleRowSelector.selectedEffectType}">
<f:selectItems value="#{sampleRowSelector.EFFECT_TYPES}" />
</h:selectOneRadio>
</h:panelGrid>
</ice:panelGroup>
<ice:panelGroup style="padding-left:1%;">
<ice:panelGroup>
<ice:panelGroup style="padding-top:2%;">
<ice:dataTable id="logicalSystems"
value="#{sampleRowSelector.logicalSystems}" var="item"
style="width:650px" rows="7" binding="#{sampleRowSelector.iceTable}" ><!-- binding="#{sampleRowSelector.iceTable}" -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{msgs['system_property.name']}"
arrow="true">
<ice:outputText value="#{msgs['system_property.name']}" />
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.sysName}" />
</ice:column>
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{msgs['backend.logical_system.descr']}"
arrow="true">
<ice:outputText
value="#{msgs['backend.logical_system.descr']}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.description}" />
</ice:column>
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{msgs['system_property.sys_type']}"
arrow="true">
<ice:outputText
value="#{msgs['system_property.sys_type']}" />
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.sysType.description}" />
</ice:column>
</ice:dataTable>
</ice:panelGroup>
</ice:panelGroup>
</ice:panelGroup>
</ice:panelTab>
</ice:panelTabSet>
</ice:form>
</body>
</html>
</f:view>
</jsp:root>
这是我的处理程序类
import com.unvired.ump.ac.util.SessionObject;
import com.unvired.ump.api.pojo.LogicalSystem;
import com.unvired.ump.core.session.EntityOperationsBean;
import com.unvired.ump.hibernate.facades.UMPServiceLocator;
import com.icesoft.faces.component.ext.HtmlDataTable;
import com.icesoft.faces.context.effects.Pulsate;
import java.io.Serializable;
import javax.faces.model.SelectItem;
public class SampleRowSelector implements Serializable
{
private EntityOperationsBean entitylocal = (EntityOperationsBean) UMPServiceLocator.getBean(EntityOperationsBean.class);
private LogicalSystem[] logicalSystems;
private boolean isLogicalSystemTableReload = false;
private HtmlDataTable iceTable;
private String searchQuery;
private String selectedEffectType = "default";
private String selectedSearchMode = "contains";
private String[] selectedColumns = new String[]{"systemName", "description", "systemType"};
private int lastFoundIndex = -1;
private boolean caseSensitive;
private boolean noResultsFound = false;
public final SelectItem[] SEARCH_MODES = {new SelectItem("startsWith", "Starts With"),
new SelectItem("endsWith", "Ends With"),
new SelectItem("contains", "Contains"),
new SelectItem("exact", "Exact Match")};
public final SelectItem[] COLUMNS = {
new SelectItem("systemName", "System Name"),
new SelectItem("description", "Description"),
new SelectItem("systemType", "System Type")};
public final SelectItem[] EFFECT_TYPES = {new SelectItem("none", "None"),
new SelectItem("default", "Default (Highlight)"),
new SelectItem("pulsate", "Pulsate")};
public SelectItem[] getSEARCH_MODES() {
return SEARCH_MODES;
}
public SelectItem[] getCOLUMNS() {
return COLUMNS;
}
public SelectItem[] getEFFECT_TYPES() {
return EFFECT_TYPES;
}
public LogicalSystem[] getLogicalSystems()
{
try{
logicalSystems = entitylocal.getAllSystems(SessionObject.getCompanyInSession());
}
catch(Exception e)
{
e.printStackTrace();
}
return logicalSystems;
}
public boolean isLogicalSystemTableReload()
{
return isLogicalSystemTableReload;
}
public void setLogicalSystemTableReload(boolean isLogicalSystemTableReload)
{
this.isLogicalSystemTableReload = isLogicalSystemTableReload;
}
public void setLogicalSystems(LogicalSystem[] logicalSystems)
{
this.logicalSystems = logicalSystems;
}
public HtmlDataTable getIceTable()
{
return iceTable;
}
public void setIceTable(HtmlDataTable iceTable)
{
this.iceTable = iceTable;
}
public String getSearchQuery()
{
return searchQuery;
}
public void setSearchQuery(String searchQuery)
{
this.searchQuery = searchQuery;
}
public String getSelectedEffectType()
{
return selectedEffectType;
}
public void setSelectedEffectType(String selectedEffectType)
{
this.selectedEffectType = selectedEffectType;
}
public String getSelectedSearchMode()
{
return selectedSearchMode;
}
public void setSelectedSearchMode(String selectedSearchMode)
{
this.selectedSearchMode = selectedSearchMode;
}
public String[] getSelectedColumns()
{
return selectedColumns;
}
public void setSelectedColumns(String[] selectedColumns)
{
this.selectedColumns = selectedColumns;
}
public boolean isCaseSensitive()
{
return caseSensitive;
}
public void setCaseSensitive(boolean caseSensitive)
{
this.caseSensitive = caseSensitive;
}
public boolean isNoResultsFound()
{
return noResultsFound;
}
public void setNoResultsFound(boolean noResultsFound)
{
this.noResultsFound = noResultsFound;
}
public void find(javax.faces.event.ActionEvent e) {
lastFoundIndex = iceTable.findRow(searchQuery, selectedColumns, lastFoundIndex + 1, selectedSearchMode, caseSensitive);
if (lastFoundIndex != -1) {
noResultsFound = false;
if (selectedEffectType.equals("default"))
iceTable.navigateToRow(lastFoundIndex);
else if (selectedEffectType.equals("pulsate"))
iceTable.navigateToRow(lastFoundIndex, new Pulsate());
else if (selectedEffectType.equals("none"))
iceTable.navigateToRow(lastFoundIndex, null);
} else {
noResultsFound = true;
}
}
}