is-search-field
This component is an extended textbox component. In addition to the text box, there are buttons that can open searches, among other things. In addition to opening a search mask, you can also search directly by typing in the value.
To extend the is-search-field with a multiselect, you have to specify "is-search-multi-select-field" as type.
Properties
Property |
Description |
required |
Example |
listWidth |
The width of the list can be specified here. |
|
"listWidth" : 450 |
readOnlyTextField |
If the field should not to be edited manually, this property must be true. For example, the field can only be edited via the search button. |
|
|
dataTextField |
The text is loaded from the entity. Here you select which property is read. |
|
|
dataValueField |
The text is loaded from the entity. Here you select which property serves as the key. |
|
|
focus |
If the focus is to be on this field when the page is loaded, this property must be set to "true". It should be ensured that the property "focus" is only set to true for one component, otherwise the last component rendered will receive the focus if several have this property. |
|
"focus": true |
Adaptation possibilities
autocomplete
If you want suggestions to appear while you are typing, you can do this with the "autoComplete" properties. The suggestions are then displayed in a list. In order to be able to use this functionality, the property "autocompleteEnabled" must be true. If the displayed values are to be styled within the list, a template can be assigned to the property "autocompleteTemplate". Further information on templates can be found here. Behind "autocompleteUrl" you add the controller endpoint from where the elements of the list are to be drawn. If the controller endpoint requires additional input, the name of the parameter must be assigned to the property "autocompleteAdditionalFilterParameterName". The value to be passed is at "autocompleteAdditionalFilterParameter". The property "autocompleteDataTextField" determines which property of the elements in the list is to be displayed.
"autocompleteEnabled"
:
true
,
"autocompleteTemplate"
:
"<table cellspacing='0' style='table-layout:fixed; width:650px'><colgroup><col style='width: 100px' /><col style='width: 250px' /><col style='width: 300px' /></colgroup><tr style='background-color:# if(data.Status == 1) { #\\#cccccc# } else { #inherit# } #'><td style='vertical-align:top'>${data.MaschNr}</td><td style='vertical-align:top'>${data.MaschBezeichnung}</td><td style='vertical-align:top'>${data.AdrName}</td></tr></table>"
,
"autocompleteUrl"
:
"MachineLookup/Find"
,
"autocompleteDataTextField"
:
"MaschNr"
,
"autocompleteAdditionalFilterParameterName"
:
"adrNr"
,
"autocompleteAdditionalFilterParameter"
:
"entity.Adresse_Key"
Customise the search
If you want to have the button that opens a search, the property "searchButtonEnabled" must be true. The reference of the button is placed behind "searchWindowTitle". The URL that should open the search is assigned to the property "searchWindowUrl".
If the search is to be preselected, the name of the value that is to be selected must be assigned to the property "searchWindowUrlParameterName" and the value itself is assigned to "searchWindowUrlParameterModel".
For additional parameters, the properties "searchWindowUrlAdditionalParameterName" and "searchWindowUrlAdditionalParameterModel" can be used. Handling here is exactly the same as for "searchWindowUrlParameterName" and "searchWindowUrlParameterModel".
"searchButtonEnabled"
:
true
,
"searchWindowTitle"
:
"{{{Ressource.Ressourcensuche}}}"
,
"searchWindowUrl"
:
"DynamicSearch/Window/Resource?withSkills=true"
,
"searchWindowUrlParameterName"
:
"projnr"
,
"searchWindowUrlParameterModel"
:
"entity.ProjNr"
,
"searchWindowUrlAdditionalParameterName"
:
"pindex"
,
"searchWindowUrlAdditionalParameterModel"
:
"entity.PIndex"
Extension to the Multiselect
If the type is "is-search-multi-select-field" you get a multiselect instead of a textbox. It is important that the properties "searchTextField" and "searchValueField" are set. "SearchTextField" indicates which property should be displayed in the text and "searchValueField" the value that is linked to the displayed text. It is also important that the value in "searchWindowUrl" is adapted to the multiselect.
If you want to customise the design of the displayed values, you can do this with a template. You can find more information about the templates here. If you want to use a template, you must make sure that both "searchTextField" and "searchValueField" are set. The values are then stored in an object with the name "data". This object contains the properties "Name" and "Value".
"type"
:
"is-search-multi-select-field"
,
...
"searchWindowUrl"
:
"DynamicSearch/Window/Address?multi=true&displayPattern=[[adrname]]"
,
"searchTextField"
:
"adrname"
,
"searchValueField"
:
"adrnr"
,
"displayTemplate"
:
"<span>#:data.Name# (#:data.Value#)</span>"
New-Button
It is also possible to create a "New" button that opens a sheet, where you can create a new entity. The key of the newly created entity is automatically added to the text box or the multiselect field after saving and closing the sheet. If you want to have such a button, the property "newButtonEnabled" must be true. In addition, you need the URL that should be opened, when you click on the button. This URL is assigned to the property "addNewUrl". If certain properties of the entity are already set, this can be done with the help of the property "addNewUrlParameters". The keys in the object are the parameters of the URL that is stored with "addNewURL". These keys are assigned the values that are to be in the new entity.
"newButtonEnabled"
:
true
,
"addNewUrl"
:
"Address/New?isWindow=true"
,
"addNewUrlParameters"
: {
"initAddress"
:
"entity.Adresse_Key"
,
"initMachine"
:
"entity.Maschine_Key"
,
"initTicket"
:
"entity.ProblemNr"
}
Other Buttons
The is-search-field component also offers a button with a delete function. When this button is pressed, the content in the text box or in the multiselect is deleted. To activate this button, the property "deleteButtonEnabled" must be true.
Furthermore, the component offers the possibility to create customised buttons. For this, the property "customButtonEnabled" must be true. The reference of this button is assigned to "customButtonTitle". The function that is called in the corresponding component is assigned to "customButtonFunction".
"customButtonEnabled"
:
true
,
"customButtonFunction"
:
"copyFaultCode()"
,
"customButtonTitle"
:
"{{{WebSMS.Procedure.CopyFaultCode}}}"