|Accessing the SearchForm from a TablePage [message #1780396]
||Mon, 22 January 2018 07:47
| Urs Beeli
Registered: October 2012
Location: Bern, Switzerland
We are using extensions to AbstractPageWithTable in which we use getConfiguredSearchForm() to define the search form. We then implement the execLoadData() method, which is called when the search button is pressed. It takes a SearchFilter parameter from which we can get the pre-filled SearchFormData object containing our search criteria. This object is then passed to our OutlineService implementation which uses it to retrieve the required data from our backend. As we keep our backend scout-free, we are moving the contents of the SearchFormData class into another DTO which we then pass from the OutlineService into our backend layer. We have succesfully been using this approach for a few years.|
So far, so good.
However, as we are migrating from Eclipse to IntelliJ as IDE we no longer have the possiblity to auto-generate the SearchFormData from the SearchForm (this is done by the Eclipse Scout Plugin). Our idea is to do without the SearchFormData and instead already populate our own DTO in the client instead of the server. The idea is to do this in the AbstractPageWithTable.execLoadData() method of our table page, we would like to get access to the search form, so we could retrieve the field contents and write those into our DTO, we would then call the OutlineService with this DTO instead of the SearchFormData.
The problem is, that I don't currently see how we can access the SearchForm from our TablePage. The SearchFilter bean does not seem to contain a reference to the SearchForm. Is there any way to get a reference to the SearchForm instance? We do know its class (thanks to getConfiguredSearchForm), is there a way to ask Scout for the instance of that class? Can we just use BEANS.get(MySearchForm.class)?
Powered by FUDForum
. Page generated in 0.01977 seconds