Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Initializing properties for form objects

Avatar

Level 2

If I want to set starting values for some form objects as soon as the form opens, what's the best event to use?

I want to set a date field's value to the current date.

I also want to set the Presence property of some objects to "Visible" or "Invisible" at startup. In particular, I want to set all of the objects in a group to "Invisible", but while the group has a Presence property, "Invisible" isn't one of the default values it can have. I'm hoping I don't have to set the presence of every object in the group individually.

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can use either LayoutReady or Initialize events to set the default values for fields.

If you place all those fields in the group as part of a Subform, then you can set the presence property of the subform to "hidden" or "invisible" based on the need.

In that case you do not need to set the presence property individually.

Thanks

Srini

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

You can use either LayoutReady or Initialize events to set the default values for fields.

If you place all those fields in the group as part of a Subform, then you can set the presence property of the subform to "hidden" or "invisible" based on the need.

In that case you do not need to set the presence property individually.

Thanks

Srini