How type ahead works
This blog is relevant for SAP Hybris Cloud for Customer .
As you can see in image below (Figure 1) there is a field with a value help into which I’ve typed “13” and the system returns 3 records .
This is called type ahead and in this blog I’ll explain how this works including how the system determines which records should be shown in the drop down .
Type ahead feature works for input fields and also fields in the advanced find form provided a value help is linked to it .
If you click on the value help icon next to the field then a popup appears as can be seen in figure 2 below . The basic search has been highlighted by a red box .
When a user enters a value into this basic search then it searches across columns of the list below . Each OVS has a list of columns against which this search is done by the system .
The important thing to note is that this search is not for a specific column .
The type ahead feature of the input field is bound to this basic search and behaves in exactly the same manner .
To understand this let us look at the data set below in figure 3 .
Let us suppose these are the only 4 records in the value help for the Installation Point ID field and also let’s assume that the search is configured to work across all of these columns .
If a user types in “B1” in this field then all 4 records will appear in the type ahead drop-down since the ID of each record has “B1” in it .
If a user types in “sid_” then record 1 and record 2 will appear in the type ahead drop-down since the serial id of these 2 records contains “sid_”.
If a user types in “24” then record 1 and record 4 will appear in the type ahead drop-down since the location of these 2 records contains “24”.
If a user types in “B1001” then only 1 record will appear in the type ahead drop down because right now in this data set there is only 1 record which contains “B1001” .
However, if a fifth record is added to this data-set such that the serial ID or name or location has “B1001” in it then typing “B1001” will result in 2 records in type ahead drop down .
So , it’s important to understand that the type ahead is not designed to return a unique record but a list of records that matches what has been entered . If a single record is coming then it’s because of the data and as we all know data can and will change over time .