在我的 XPage 上,我有一系列搜索过滤器(州、名字和姓氏)。搜索按钮触发绑定到托管 Bean 的数据表的填充。
数据表最初填充了数据行。但是,当我单击 Next(在寻呼机中)时,它不会加载接下来的 5 行,而是不再返回数据。我知道数据表的行数正确,因为如果我将数据表中的重复限制更改为 10,它们都会显示。此外,寻呼机中的页数为 2(这是正确的数字)。
有什么想法可能导致这种情况吗?
谢谢,
担
数据表代码:
<xp:dataTable rows="5" id="studentTable" var="currentStudent"
style="width:400.0px" value="#{studentlist.students}">
<xp:column id="firstnameColumn" style="font-weight:bold">
<xp:this.facets>
<xp:span xp:key="header">
<xp:span style="font-weight:bold">
First Name
</xp:span>
</xp:span>
</xp:this.facets>
<xp:text escape="true" id="firstnameField"
value="#{currentStudent.firstname}">
</xp:text>
</xp:column>
<xp:column id="column1">
<xp:text escape="true" id="middleinitialField"
value="#{currentStudent.middleName}">
</xp:text>
<xp:this.facets>
<xp:span xp:key="header">
<xp:span style="font-weight:bold">
Middle Name
</xp:span>
</xp:span>
</xp:this.facets>
</xp:column>
<xp:column id="lastnameColumn" style="font-weight:bold">
<xp:this.facets>
<xp:span xp:key="header">
<xp:span style="font-weight:bold">
Last Name
</xp:span>
</xp:span>
</xp:this.facets>
<xp:text escape="true" id="lastnameField"
value="#{currentStudent.lastname}">
</xp:text>
</xp:column>
<xp:column id="idColumn">
<xp:this.facets>
<xp:span xp:key="header">
<xp:span style="font-weight:bold">ID</xp:span>
</xp:span>
</xp:this.facets>
<xp:text escape="true" id="computedField1"
value="#{currentStudent.id}">
</xp:text>
</xp:column>
<xp:this.facets>
<xp:pager layout="Previous Group Next" xp:key="header"
id="pager1" for="studentTable" partialRefresh="true">
</xp:pager>
</xp:this.facets></xp:dataTable>
按钮后面的代码:
var state=getComponentValue('state');
var firstName=document1.getItemValueString("firstName");
var lastName=document1.getItemValueString("lastName");
if(state == "--" || firstName == "" || lastName == "")
{
//do nothing
}
else{
studentlist.setConnDB("jdbc:sqlserver://XX.XX.X.XX:1433;DatabaseName=dan_test");
studentlist.setConnUserName("test");
studentlist.setConnPassword("Password1");
studentlist.setSQLQuery("SELECT FirstName,MiddleName,LastName,ID FROM TestStudents WHERE FirstName Like '"+firstName+"%' AND LastName Like '"+lastName+"%' AND State = '"+state+"' ORDER BY LastName ASC");