Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83469

JavaAction does not Return New Uncommited Object

$
0
0
Use Case: We have an Entity that is Passed into a Java Action. Inside the Action we clone this Object, some Magic happens, and some Attributes will be Changed on the new Object using the SetValue Java (IMendixObject)Method. After we return the New Object to the “MX Context” the changes are Lost, the Members are still having the Values of the Original Object PseudoCode (executeAction): → JAVA CONTEXT MyType  newObject = MyType .initialize(userContext, originalObject.getMendixObject()); IMendixObject newMendixObject = newObject.getMendixObject(); log(newMendixObject.getValue(“attrName”);   // Will Print oldValu newMendixObject .setValue(userContext, “attrName”, “newValue”); // Apply the Changes log(newMendixObject.getValue(“attrName”);   // Will Print newValue return newMendixObject; → MX Context The Returned Object still has the values of the Original Object and not the newValue

Viewing all articles
Browse latest Browse all 83469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>