OK, so you knew you were using ListGrid.searchForm. Here are the current docs for this property:
---
When declared, the specified form is automatically used as a search form for this grid, with criteria that are additive with any criteria shown in the FilterEditor or Filter Window.
For a discussion of the various filtering and criteria-management APIs and when to use them, see the Grid Filtering overview.
This is similar to the effect of adding a filterEditorSubmit() override that pulls in criteria from the external form, and having the external form call filterByEditor() instead of fetchData(), as shown in the +exampleLink{additiveFilter} example.
In particular. the grid will automatically filter when the searchForm.search() or dynamicForm.submit() event fires on the form (happens if a SubmitItem is present and is pressed), and will automatically trigger filtering if enter is pressed in the form, as though searchOnEnter / saveOnEnter had been set.
If the FilterEditor is enabled and listGrid.filterOnKeypress is set, the grid will automatically watch for searchForm.criteriaChanged(), and filter whenever that method fires. For the purposes of this behavior, the FilterEditor is considered to be enabled even if it is not currently visible but canShowFilterEditor is true (as otherwise filtering behavior in the form would change when the FilterEditor appears).
The criteria from the specified searchForm will only be shown and edited in the external form; they will neither be shown nor editable in the FilterEditor, even if the FilterEditor also allows criteria on the same fields. That is, they are treated much like implicitCriteria.
Note: when using listGrid.searchForm don't add your own logic to call fetchData() or the criteria you specify will appear in the FilterEditor and be editable there, potentially creating user confusion, especially if some of the criteria in your form cannot be displayed and edited in the FilterEditor.
---
So, SearchForm is very useful when you just want to use the standard criteria that are provided by a SearchForm. If you want to modify those criteria in some way, you're in luck, because the docs for SearchForm explain exactly how it works, making it very, very easy to replicate it's behavior if you need to change something.
Also, if you just click around a bit on those links, you immediately hit all kinds of clear information on how criteria are derived from form values, and how to customize that process.
So given that you knew you were using this property and head read the docs for it, it is difficult to understand many of the things that happened in this thread:
1. you kept talking about a mysterious second request from the comboBoxItem, when of course, this request is from the grid itself, because of your listGrid.searchForm setting
2. you repeatedly mentioned problems with how the ComboBox fetches its data, and APIs, such as getPickListFilterCriteria(), that clearly affect how the comboBox fetches pickList data., when apparently the whole time the problem was the ListGrid's fetch initiated by listGrid.searchForm, where those APIs are irrelevant
3. even though we repeatedly mentioned that the issue involves how the criteria get from the searchForm to the grid, you never revealed that this was being done via a listGrid.searchForm setting. We ultimately just guessed it! And, you also never looked into this area, never looked at the docs for searchForm.getValuesAsCriteria(), it would seem - just ignored the way that the docs and the Support team were point you right at the solution
This whole trainwreck would have been avoided if your first question were something like: "I've got a comboBox in a SearchForm and I'm using listGrid.searchForm to include that criteria in a ListGrid. How can I customize the criteria applied to the listGrid?". Except of course, there wouldn't be a need to post that - because the docs for listGrid.searchForm already give you the solution.
So:
1. if you see some way in which the docs could be improved, please let us know. In the listGrid.searchForm docs, we see one method reference that could be made a live link. Other than that, we're looking to you for how it could be improved.
2. please use ChatGPT as your first line support instead of this forum. We cannot afford to run in circles like this, especially for someone who doesn't have paid support. Note that ChatGPT basically answers our corrected version of your initial question immediately. However, with your original question, it heads off in the same wrong directions we did, as expected.
---
When declared, the specified form is automatically used as a search form for this grid, with criteria that are additive with any criteria shown in the FilterEditor or Filter Window.
For a discussion of the various filtering and criteria-management APIs and when to use them, see the Grid Filtering overview.
This is similar to the effect of adding a filterEditorSubmit() override that pulls in criteria from the external form, and having the external form call filterByEditor() instead of fetchData(), as shown in the +exampleLink{additiveFilter} example.
In particular. the grid will automatically filter when the searchForm.search() or dynamicForm.submit() event fires on the form (happens if a SubmitItem is present and is pressed), and will automatically trigger filtering if enter is pressed in the form, as though searchOnEnter / saveOnEnter had been set.
If the FilterEditor is enabled and listGrid.filterOnKeypress is set, the grid will automatically watch for searchForm.criteriaChanged(), and filter whenever that method fires. For the purposes of this behavior, the FilterEditor is considered to be enabled even if it is not currently visible but canShowFilterEditor is true (as otherwise filtering behavior in the form would change when the FilterEditor appears).
The criteria from the specified searchForm will only be shown and edited in the external form; they will neither be shown nor editable in the FilterEditor, even if the FilterEditor also allows criteria on the same fields. That is, they are treated much like implicitCriteria.
Note: when using listGrid.searchForm don't add your own logic to call fetchData() or the criteria you specify will appear in the FilterEditor and be editable there, potentially creating user confusion, especially if some of the criteria in your form cannot be displayed and edited in the FilterEditor.
---
So, SearchForm is very useful when you just want to use the standard criteria that are provided by a SearchForm. If you want to modify those criteria in some way, you're in luck, because the docs for SearchForm explain exactly how it works, making it very, very easy to replicate it's behavior if you need to change something.
Also, if you just click around a bit on those links, you immediately hit all kinds of clear information on how criteria are derived from form values, and how to customize that process.
So given that you knew you were using this property and head read the docs for it, it is difficult to understand many of the things that happened in this thread:
1. you kept talking about a mysterious second request from the comboBoxItem, when of course, this request is from the grid itself, because of your listGrid.searchForm setting
2. you repeatedly mentioned problems with how the ComboBox fetches its data, and APIs, such as getPickListFilterCriteria(), that clearly affect how the comboBox fetches pickList data., when apparently the whole time the problem was the ListGrid's fetch initiated by listGrid.searchForm, where those APIs are irrelevant
3. even though we repeatedly mentioned that the issue involves how the criteria get from the searchForm to the grid, you never revealed that this was being done via a listGrid.searchForm setting. We ultimately just guessed it! And, you also never looked into this area, never looked at the docs for searchForm.getValuesAsCriteria(), it would seem - just ignored the way that the docs and the Support team were point you right at the solution
This whole trainwreck would have been avoided if your first question were something like: "I've got a comboBox in a SearchForm and I'm using listGrid.searchForm to include that criteria in a ListGrid. How can I customize the criteria applied to the listGrid?". Except of course, there wouldn't be a need to post that - because the docs for listGrid.searchForm already give you the solution.
So:
1. if you see some way in which the docs could be improved, please let us know. In the listGrid.searchForm docs, we see one method reference that could be made a live link. Other than that, we're looking to you for how it could be improved.
2. please use ChatGPT as your first line support instead of this forum. We cannot afford to run in circles like this, especially for someone who doesn't have paid support. Note that ChatGPT basically answers our corrected version of your initial question immediately. However, with your original question, it heads off in the same wrong directions we did, as expected.
Comment