I would like to use typeAhead functionality in a inputBox. Values should get only the first categorized column( Column[0]); Because I have so many document belong to the same customer. I only need customer names as unique. Please find what i tried so far below. in this view only the first column is categorized. Others are not. I think i miss something :(
<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>