Screen becoming blank

0
Hi, I am facing an issue. I am converting Persistent Objects to Non-Persistent and then I am downloading the NP objects using Java Action. After download, I tried to add new thing to the NP object and when I am clicking on Save button (customize microflow), the screen is becoming blank. No logs have been shown. I placed the debugger and the control is not even coming to the save microflow. Please suggest what could be the issue. Thanks, Varun
asked
2 answers
1

You've changed persistable entitities to non persistables entities in your database?

You're now trying to use these non-persistable entities in a java action.

This will most likely cause problems because the java actions are done by the server, meaning the data will most likely be lost because the entity transfers from the user session to the server. The server will probably then remove the non persistable entity after its done performing the java action to it. Which is why it will no longer exist for the new view and it shows a blank page.

Perhaps it requires extra java functions to keep the non persistable in memory and the session going for that user.

I can't promise this is why it happens but I do not have the java functions you're using or project insights required to discover where the exact issue exists.

answered
0

Answer to Repala's comment in my other answer: "Which java actions are present to store objects at runtime and not losing them in user session??"

There are 2 ways, you can pass the context of the object to the java action using this.getContext(), which should allow you to access the non-persistable objects or at least return them to the user session.

Or you can use this in your java action: ISession.retain() method ("this.getContext().getSession().retain(IMendixObject)")

You will need to do a cleanup of your non-persistable objects later after you're done with them.

Read the following documentation for more details about the session object:

https://apidocs.mendix.com/3/runtime/interfacecom11mendix11systemwideinterfaces11core11isession.html

And for the context object:

https://apidocs.mendix.com/3/runtime/interfacecom11mendix11systemwideinterfaces11core11icontext.html

answered