Friday, September 5, 2014

Enabling Auto-complete on Selectors

In Acumatica we have a very widely used control - Selector. This one allows user to pick a certain object from a potentially long list. In addition to providing a convenient look-up table selectors also allow for manual input - in this case user simply enters the key of the object they wish to chose. To permit faster data entry and reduce the chance for mistakes Acumatica selectors have auto-completion capability, which is very easy to enable.

First of all, assume that you have a selector for Credit Terms, which looks more or less like this:


In the ASPX page definition it is represented by the following code:

<px:PXSelector ID="edTermsID" runat="server" DataField="TermsID" AutoRefresh="True" DataSourceID="ds" />

In this state, if the user starts typing in the selector box nothing specific will happen until they press F3 on the keyboard or click the magnifying glass icon to open the look-up table or proceed to the next field. However, it is very easy to change this - just add the AutoComplete attribute to the selector definition:

<px:PXSelector ID="edTermsID" runat="server" DataField="TermsID" AutoRefresh="True" DataSourceID="ds" AutoComplete="True" />

Once this is done, the selector box will suggest possible choices. This not only means that user will know what to enter - they can easily navigate through the suggestions list using arrow keys on the keyboard and press Enter key to pick the one they look for.


No comments:

Post a Comment