Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

docReady events slow form down

Avatar

Level 4

Javascript in the docready event really seems to burden the form-anyone why this is?

I'm building in an "expiration" feature that will basically shut the form down after a certain date is passed.  However, I did this using if/else statements on the docReady event as I couldn't get it to work on the initialize event.

Any way to get around using this event? Really I just need pages to be hidden if a current date field is >= to a hard-coded date (which is a form variable), so the code is not very long, which is why I'm surprised it has impacted form performance.

2 Replies

Avatar

Level 10

Hi,

I like the docReady event, as it is the last event to fire as the form is being rendered and does not fire again. Note, if the form is Reader Enabled, then the docReady event will fire twice. See discussion here: http://forums.adobe.com/message/3040556#3040556  and example form here: http://assure.ly/gW3RNr.

I have an example here that uses the docReady event and didn't notice a performance issue (but then it is a small form): http://assure.ly/frjYW5.

Niall

Avatar

Level 4

Well, I tried it again, and there were no negative effects on form performance....

If I find out anything else, I'll post.