Interesting problem anyone seen this?

I am wanting to populate a form from an entity, and didn’t see anything in ColdBox that might do the trick. So I began to roll my own and came across this problem where the previously saved data is grabbed.

var objMember = ORMService.new(‘Member’);

var objData = getMetaData(objMember).properties;

writeDump(objData); abort;

Now if I dump objMember it is 100% empty as expected, but the moment I use getMetaData, it populates the objData with previous data from a previous entity save.

Anyone seen this, know how to get around it?

Regards,

Andrew Scott

http://www.andyscott.id.au/

The only thing I have seen with metadata is that in cf9 it is cached, meaning that if you do a direct reference and manipulate it in any way, the changes remain in effect. This is a CF issue as far as I have seen it. So everything we do in ColdBox with metadata we try to either duplicate it or not modify it.

Luis F. Majano
President
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yeah I figured that it was cached, it just through me that I was creating a completely new entity. Kinda makes sense for performance issues.

But if you have a better way of taking the entity and populating a form, I would appreciate it. Was hopping that CB had something, I could see a getProperties, but I also needed the values of the properties as well.