Tuesday, December 21, 2010

What is the execution phase inside VoRowImpl file?

Problem Description :

When we code logic inside the VoRowImpl file for making any changes to a UI page through a VO, we make use of the getters and setters of the VO attributes. Normally, for displaying any data on the UI page, the getters are called first. When the values to any of these attributes change, we make use of the setters to set new values. After this, the getters are again called in order to display the new values on the UI page.

But, at point in time, is there any way to know where exactly we are like :

1. Initial getters phase that displays the old values in the database
2. Setters phase which sets the modified values to the attributes.
3. Final getters phase which displays the modified values in the database.


Solution:

Not sure why you need to know this. An EO can be used in UI, and other batch program/service where these phases don't make sense.

You can always check the EO state (postState for example) to examine whether an EO is an existing and not modified, or modified, or new, etc.

No comments: