1
我想在inputBox中使用typeAhead功能。值应该只有第一个分类列(Column [0]);因为我有这么多文件属于同一个客户。我只需要客户名称作为唯一。请在下面找到我尝试的内容。在这个视图中只有第一列被分类。其他人不是。 我想我错过了什么:(从XPages中的typeAhead中的第一个分类视图列中获取值
<xp:inputText id="inpCustomer" value="#{document1.CustomerName}">
<xp:typeAhead mode="partial" minChars="2" ignoreCase="true" var="lupkey" valueMarkup="true" id="typeAhead1">
<xp:this.valueList><![CDATA[#{javascript:try
{
var procedureName = "fonck1";
var searchOutput:Array = [];
var v:NotesView = database.getView("(ctgViewName)");
var nav:NotesViewNavigator = v.createViewNavFromCategory(lupkey);
var viewEnt:NotesViewEntry = nav.getFirstDocument();
var tmp:NotesViewEntry;
while (viewEnt !== null)
{
searchOutput.push(entry.getColumnValues()[0]);
tmp = viewEnt;
viewEnt = nav.getNextCategory();
tmp.recycle();
}
var result ="<ul><li><span class='informal'></span></li>";
var limit = Math.min(hits,200);
for (j=0; j<limit; j++)
{
var name = searchOutput[j].toString();
var start = name.indexOfIgnoreCase(lupkey)
var stop = start + lupkey.length;
name = name.insert("</b>",stop).insert("<b>",start);
result += "<li>" + name + "</li>";
}
result += "</ul>";
return result;
}
catch(e)
{
print(e.toString());
throw(e);
}}]]></xp:this.valueList>
</xp:typeAhead>
<xp:this.attrs>
<xp:attr name="placeholder" value="Please enter customer name..." />
</xp:this.attrs>
</xp:inputText>