This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 22, 2012, 1:33 AM
19 Posts

Type Ahead / Ajax for View Control

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags: AJAX,View Control,Type Ahead
  • Replies: 1
 Hi All,
 
I am wondering is there a way to connect a type ahead / Ajax field to a View Control?I have a simple edit box which does the full text search but I really want the type ahead instead.I have searched all around and can't seem to find anything on this.
 
Anyone?
Feb 22, 2012, 7:11 AM
22 Posts
Re: Type Ahead / Ajax for View Control
Hi
 
I had the same question a couple of days ago and I got it working :o)
 
It's quite difficult to explain but I'll give it a try - I have enclosed all code in curly braces { } : 
 
You need a custom control with one field called searchValue that has the following code in the Event "onKey" / Server /Script Editor -> { viewScope.searchValue=getComponent("inputSearch").getValue() + "*" }. The searchValue field needs to do a Partial Update where you specify the element id as { compositeData.id_ForPartialRefresh }. You also need to create a Property Definition on the searchValue Custom Control that I called id_ForPartialRefresh (you need to have the custom control selected and not the field).
 
You then create a new custom control containing the searchValue custom control and the view underneath - I did try doing it with 2 custom controls on an xPage but I could not get it to work - I just assume that I am missing something! Anyway, select the searchValue custom control and select the Custom Property - you should see the property id_ForPartialRefresh from the previous step -> set this to the view name. The final thing to do is select the view, go to All Properties / Data / Data / search and set the search to { viewScope.searchValue }
 
That's it - worked for me! 
 
There are a few buts.... I add "*" to the search string but this causes the search to be empty (and not display everything as I would have assumed) if I select a couple of letters and then delete them. Not quite sure why this is. If you do not add the * the search only returns whole words (which is how the FT works in Notes as well). The returned search is not sorted which kinda sucks.
 
Hope this helps - otherwise drop me a mail @ ursus dot schneider @ gmail dot com and I'll try and help :o)
 
Greetings 
Ursus

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal