Tuesday, April 19, 2011

Type Ahead in XPages

Type ahead is a cool feature which i would love to have it in notes client based application.  When I started to explore about x pages, the first thing that I looked for is Type ahead.  When I googled for type ahead I ended in the following pages.
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesTypeAheadValueMarkup.htm
http://www.bleedyellow.com/blogs/YellowNotes/entry/xpages_type_ahead_feature_with_large_view2?lang=en

Based on the above, I developed the below code.

<xp:inputText id="inputText1">
        <xp:typeAhead var="startValue"  mode="partial" minChars="3" ignoreCase="true" id="typeAhead1">
        <xp:this.valueList><![CDATA[#{javascript:var db1 = new Array("", "xpages\\chapter10.nsf");
        key1 = startValue;
        var ret = new Array();
        ret = @DbLookup(db1, "By Author", key1, 1 ,"[PARTIALMATCH]");
       
        @Unique( ret );}]]></xp:this.valueList>
        </xp:typeAhead>
    </xp:inputText>




Note : The view shouldn't be categorized. If the view is categorized, then only first value would be returned.





No comments:

Post a Comment