Open a page with an unsaved object from Java.

0
Hi there,   I am trying to work on a custom RequestHandler, which will open a new / edit page with an unsaved object. Currently what happens is that a microflow will create the necessary object when the end user navigates to the URL that the RequestHandler is listening at. Though, if I try open the given page by supplying a SEE_OTHER status and a location header field, I then get an error with “The page you requested was not found. You are redirected to the home page.”, because the object has been disposed of by Mendix when the microflow ends.   While I am aware that add-ons such as DeepLink exists, that add-on does not fully support the requirements I have for the given URL path, as well as always redirecting back to the index page.   Given I have an IMendixObject, createdObject, as a result of calling the microflow, and that my desired page is located at /p/demo/page/{Id}, how will I be able to open the page for the end user with the created object without having to commit it first? (The created object should only be committed when the user clicks the Save button on the desired page).   Thanks in advance.
asked
3 answers
1

Hello Andreas,

Could you create the object and show the page in a microflow? 

You can then call the microflow from Java or from a deeplink.

Hope this helps

answered
1

Hi Andreas,

You are on a good path with the SEE_OTHER. Unfortunately, it is not possible to do exactly what you have in mind. A quick and dirty workaround is to commit the object in java and use a boolean flag e.g. ‘IsSaved’ that you set when the user actually saves the object.

-Andrej

answered
0

Hi,

I’ve decided to instead make a new blank page, which has a DataView that calls the microflow I previously called from the Java code. The Java code then redirects to this new blank page, which in turn opens the desired page with the unsaved object.

answered