Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Just Curious. . .

Avatar

Former Community Member

So, when you're writing a script, if you precede the name of an object by an underscore you invoke the instanceManager (i.e. if your object is called "Thing", then _Thing invokes the instanceManager for Thing).  However, you can also begin an object name with an underscore.  So, say I had an object called "Thing" and another object called "_Thing".  If I were to type in _Thing how would LiveCycle decide whether I was talking about the object _Thing or whether I was trying to invoke the instanceManager on Thing?  It's not really that much of a problem, because you don't need to name an object starting with an underscore, but I'm still interested in how this would be resolved.

1 Reply

Avatar

Former Community Member

My guess would be that the JavaScript could figure itself out.  Say you've got two objects:

Thing

_Thing

This line of JavaScript can only mean one thing:

_Thing.addInstance()

There is no .addInstance() to an object without the instance manager.  So I would think the JavaScript engine would know that the above line means call the instance manageer of the object "Thing".

Now the question is, can you call:

__Thing.addInstance() instead of _Thing.instanceManager.addInstance()?

That's my thought on this little brain teaser.  I may be completely wrong though.

Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com