A java action that opens a page dynamically can be achieved by the following:
Create a java action with a typeparameter and 2 input parameters:
The with this java code, simple test code, you can open a form dynamically:
// BEGIN USER CODE
List<IMendixIdentifier> idList = new ArrayList<IMendixIdentifier>();
FeedbackHelper.addOpenFormFeedback(getContext(), formName, IFeedback.FormTarget.CONTENT, Parameter.getId(),idList);
return true;
// END USER CODE
Make sure to set the string correctly in the input, in my test I use the page testrecord_NewEdit from the MyFirstModule module then the string should read: 'myfirstmodule/testrecord_NewEdit'
More work will be needed to create a production proof solution, but this should help you in getting started.