Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to tell apart ready:form-event and ready:layout-event

Avatar

Level 4

Hi,

I would like to call the same function in a script object from different events.

As I cannot make layout changes in the ready:layout event I would like to find out in the function: Which event called me?

event.name gives me the event name nicely for most events. (Although the returned strings are somewhat peculiar....)

But: The ready:layout-event as well as the ready:form-event both give me "Open".

Therefore I would like to know:

How can a function tell whether it was called from ready:layout or from ready:form?

I suppose there is a much simpler solution, than trying "event.name".

Ulrich

1 Reply

Avatar

Level 10

Hi Ulrich,

Check out event.activity in LC Designer help. This gives a closer description of the event fired, eg 'docReady' instead of 'open'.

Good luck,

Niall