You can this with a two entities: searchrequest and searchresult (1:n). The form contains a dataview with searchrequest and a datagrid over the association to searchresult(s). Your search code has to create searchresult objects. Second search has to delete the previous searchresults objects or create a new searchreq+results set.
Actually you use Mendix to pass data, from and to the search engine.
Edit 1: rough guideline:.
Get the results (pseudocode);
sr = new searchresult(getContext());
sr.setText(results.get(i).Name())
sr.setsearchresult_searchrequest(searchrequest)
sr.commit.
result.add(sr);
return result
EDIT 2: You can delete beforehand in the microflow the Mendix way. Alternative in Java, something like.
String searchrequestEntityName = searchresult.entityName;
String relationName = searchrequest.MemberNames.searchrequest_searchresult.toString();
String currentObjectID = searchrequest.getId().toLong();
List<searchresult> currentresults = Core.retrieveXPathQueryEscaped(context, "//%s[%s='%s']", attachmentEntityName, relationName, currentObjectID);
For (searachresult sc : currentresults) {
sr.delete();
}
Hello,
I have a related question to the Data View with nested Data Grid over association. Suppose I create the List of Results in Mendix Microflow, how do I inject this List of Results through the association to the entity on which I created my View?
Right now, the way I do it is as follows in a Microflow but the grid won't show anything:
Edit1: Forgot to mention that I tried it on the Mendix 5 beta 6 and not beta 7.
Thanks,
Shrinivas