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.
The control accepts multiple values.
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 values to show for the a comma(,)-separated list of ids.
This call is made first when the page is first loaded and every time the control's value is changed by a default value dependency or a JavaScript.
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. Fields used in an editable grid do not use this call.
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.
Multi-autosearch works similar to a Textbox with autosearch with the main difference being that the Id lookup may contain multiple Ids.
CREATE PROCEDURE Example.MultiAutosearchTable_MultiAutosearch
@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.MultiAutosearchTableId,
T.MultiAutosearchTableName
FROM
(
VALUES
(1, 'Audi'),
(2, 'Bentley'),
(3, 'Chevrolet'),
(4, 'Volvo Cars'),
(5, 'Volvo Trucks')
) AS T (MultiAutosearchTableId, MultiAutosearchTableName)
WHERE
T.MultiAutosearchTableId IN (SELECT I FROM SoftadminUtil.Number_ParseList(@Id));
RETURN;
END;
-- If you need to be able to search for %, [], [^], _ - make sure you use the escape function below.
SELECT @Value = ISNULL(SoftadminUtil.String_EscapeLikeWildcards(@Value), '') + '%';
-- SQL Call: Search
SELECT TOP (@TopN)
T.MultiAutosearchTableId,
T.MultiAutosearchTableName
FROM
(
VALUES
(1, 'Audi'),
(2, 'Bentley'),
(3, 'Chevrolet'),
(4, 'Volvo Cars'),
(5, 'Volvo Trucks')
) AS T (MultiAutosearchTableId, MultiAutosearchTableName)
WHERE
T.MultiAutosearchTableName LIKE @Value
ORDER BY
T.MultiAutosearchTableName;
END;