10-30-2017 04:39 AM
Anyone has an idea?
I can access list of predefinied searches and run one.
I get a SearchResult. How can I open a datagrid filled by this result?
10-30-2017 08:15 AM
Yes, my code looks like this :
List<PredefinedSearch> searches = ApplicationContext.getProject().getFeatureByTitle("MyFeatureName").getPredefinedSearches();
Map<String, String> searchCriterias = new HashMap<String, String>();
SearchResult searchResult = searches.get(0).execute(searchCriterias, selectedElements);
10-30-2017 08:22 AM
change it to:
SearchController searchController = ApplicationContext.getProject().getSearchController(); // use searchController.getAllSearchesForFeature(FeatureID) or searchController.getAllSearches() or searchController.getSearchForFeatureAndName(FeatureID, String) to get the PredefinedSearch PredefinedSearch searchToExecute = .... Map<String, String> searchCriterias = new HashMap<String, String>(); Object selectedElements = ApplicationContext.getBrowser().getMapSelectionCurator().getSelectedElements(); searchController.executeSearch(searchToExecute, searchCriterias, selectedElements;
Please keep in mind, I didn't tested it ;-) Therefore it could be possible that you will find some Syntax-Errors.
01-17-2019 01:07 AM - edited 01-17-2019 01:19 AM
I have a problem with executing a search in my plugin. The datagrid is not rendered correctly when I run the execute and the datagrid is not open yet. Only when I mouseover the datagrid the elements get rendered.
When the datagrid is already open or I run the method twice, it gets rendered correctly.
Maybe this is also connected with the method being called during a GeometryCaptureAdapter run method?
I think it has to do with the executeSearch method being async but I don't know how to resolve the problem. Any ideas?