Dynamically show page based on action

1
Background: I'm currently trying to build a multivariate testing module that shows users a landing page based on certain conditions.  Problem: is it possible to dynamically "show a page" using Mendix? Say for instance, if I know the name of the page that is to be shown, is there a way for me to use a custom microflow/java action to accomplish that? If so, I'm curious to hear how others have accomplished similar functionality, or specific instructions on how I could achieve this myself.     P.S: I searched the forum + google and saw nothing to this effect.  
asked
2 answers
4

Our use case was to dynamically show any page in the application with a corresponding context object so that users could share a page they were working on with e.g. a support engineer. We combined this with a custom widget which fetched this data, send an email link to the support engineer and a deeplink to open the form.

I created a Java action (ShowForm) for Mendix 6.6.0 with the following inputs: String formName, String objectType, String objectGUID. The objectType is used for easier verification of the objectGUID: as this was called from a deeplink, it required a bit of validation before opening the form. I retrieved the object with objectGUID using XPath. The form names are a bit tricky: I don't recall if you need the fully qualified name (ModuleName.FormName.page.xml) or just a part of it.

The method you need is FeedbackHelper.addOpenFormFeedback(), documented here.

I either called

  • FeedbackHelper.addOpenFormFeedback(getContext(), formName, FormTarget.CONTENT, null, null); for forms without context object
  • FeedbackHelper.addOpenFormFeedback(getContext(), formName, FormTarget.CONTENT, object.getId(), null); for forms with a context object

 

This method then opens the form with the object with objectGUID as context object.

answered
0

Dear Rom,

I have used (FeedbackHelper.addOpenFormFeedback(getContext(), formName, FormTarget.CONTENT, object.getId(), null);) code to open page with context, when i applied it into the java action, parameter (object.getId()) not recognized into the code, could you please elaborate more about this.

 

could you please share the JAVA code you used into Mendix java action ?

answered