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

How to create a scaffold with a DatePicker?

Avatar

Level 3

I'm defining the structure of the page that my scaffold will create, but I'm failing to see how I can add a DatePicker in the Dialog Editor. I would have expected a Date(Time)Picker in the Fields grouping but no. So, how do I add a DatePicker to my scaffold?

1 Accepted Solution

Avatar

Correct answer by
Level 1

This may be a bit late...but I'll give an answer anyway.

For that particular field, you need to set the xtype property to "datetime" as opposed to "textfield" for a traditional text field.  You will probably also want to add an additional property to that node to avoid the time appearing in the field when you select a date.  Here is the info for that property:

Name:  hideTime

Type:  String

Value: true

Hope that helps!

View solution in original post

3 Replies

Avatar

Level 10

In am not sure - do you want the datepicker in a scaffolding dialog or on the web page so end users can use a datepicker to choose a date value? I am assuming the scaffolding dialog.

Here are the docs https://docs.adobe.com/docs/en/cq/5-6-1/wcm/scaffolding.html

Note in the docs the difference between a component dialog and a scaffolding dialog:

The dialog definition for a scaffold works similarly to that of a component (see Components). However a few important differences apply:

  • Component dialog definitions are rendered as normal dialog boxes (as shown in the middle pane of the dialog editor, for example) while scaffold dialog definitions, though they appear as normal dialog boxes in the dialog editor, are rendered on the scaffold page as a scaffold form (as shown in the News scaffold above).
  • Component dialogs provide fields for only those values needed to define the content of a single specific component. A scaffold dialog must provide fields for every property in every paragraph of the page to be created.
  • In the case of component dialogs, the component used to render the specified content is implicit and therefore thesling:resourceType property of the paragraph is filled in automatically when the paragraph is created. With a scaffold all the information defining both the content and the assigned component for a given paragraph must be provided by the dialog itself. In scaffold dialogs this information must be provided by using Hidden fields to submit this information on page creation.

Avatar

Level 3

smacdonald2008 wrote...

In am not sure - do you want the datepicker in a scaffolding dialog or on the web page so end users can use a datepicker to choose a date value? I am assuming the scaffolding dialog.

Here are the docs https://docs.adobe.com/docs/en/cq/5-6-1/wcm/scaffolding.html

Yes, I want a DatePicker in the scaffolding dialog. I've read the above documentation thoroughly and looked at the included demo sites (geometrix) without finding an example of how to include a DatePicker. So, how to do it?

Avatar

Correct answer by
Level 1

This may be a bit late...but I'll give an answer anyway.

For that particular field, you need to set the xtype property to "datetime" as opposed to "textfield" for a traditional text field.  You will probably also want to add an additional property to that node to avoid the time appearing in the field when you select a date.  Here is the info for that property:

Name:  hideTime

Type:  String

Value: true

Hope that helps!