Shows a textbox. When the user types in the textbox a list of search results is shown. The user can choose one value from the list or continue writing. The control only accepts values from the list of search results.
This call is made repeatedly as the user types into the textbox, and returns a list of search results for the entered value.
Gets the value to show in the textbox for a given id.
Retrieves the default value for the control.
This call is only made if there is a field validation set for the field info and the field has any content.
Performs field validation when the user leaves the field or one of its dependencies is changed, initial values set by default value and initial values in edit-mode are not validated.
When saving the validation runs server side if the field value has changed. A field value is considered changed if in new mode the value is anything other than
NULL. In edit mode it is considered changed if it has a value that was not returned by the GetEditFields procedure.
Textbox with autosearch works like a slimmed down version of "Textbox with popup". The popup is opened automatically as the user types. However, only an ID-value and a friendly value is supported, much like a dropdown control.
CREATE PROCEDURE Example.TextboxWithAutosearchTable_TextboxWithAutosearch @Id varchar(MAX) = NULL, @Value varchar(max) = NULL, @TopN int = 7 AS BEGIN -- SQL Call: ID Lookup IF @ID IS NOT NULL BEGIN SELECT T.TextboxWithAutosearchTableId, T.TextboxWithAutosearchTableName FROM ( VALUES (1, 'alpha'), (2, 'beta'), (3, 'gamma'), (4, 'delta'), (5, 'alphaalpha') ) AS T (TextboxWithAutosearchTableId, TextboxWithAutosearchTableName) WHERE T.TextboxWithAutosearchTableId = @Id; RETURN; END -- If you need to be able to search for %, , [^], _ - make sure you use the escape function below. SELECT @Value = SoftadminUtil.String_EscapeLikeWildcards(@Value); -- SQL Call: Search SELECT TOP (@TopN) T.TextboxWithAutosearchTableId, T.TextboxWithAutosearchTableName FROM ( VALUES (1, 'alpha'), (2, 'beta'), (3, 'gamma'), (4, 'delta'), (5, 'alphaalpha') ) AS T (TextboxWithAutosearchTableId, TextboxWithAutosearchTableName) WHERE T.TextboxWithAutosearchTableName LIKE ISNULL(@Value, '') + '%'; END;
Escape searched value.
SELECT @Value = SoftadminUtil.String_EscapeLikeWildcards(@Value);