AEM 6.1 Touch UI: Datepicker Field not prepopulated with stored value

Avatar

Avatar
Validate 1
Level 1
REESG
Level 1

Likes

2 likes

Total Posts

7 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
REESG
Level 1

Likes

2 likes

Total Posts

7 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
REESG
Level 1

14-03-2017

Hi!

 

I'm currently facing a strange issue:

I've a component that includes text inputs and a date picker (Resource Type: granite/ui/components/foundation/form/datepicker).

I can add and edit values for all input fields and they are shown properly on the component on the edited webpage.

The system also stores all values properly.

 

But when I re-open the dialog the value for the date selected via date picker is not shown. The date picker input field remains empty.

All other inputs are prepopulated with the stored values.

The date is shown on the component but not in the date picker.

If I save the dialog with the empty date picker value the date will be overwritten with null.

 

Any idea what I can do to show the entered date there?

 

Thanks and best regards

Sebastian

View Entire Topic

Avatar

Avatar
Boost 1
Level 1
vinayk70574604
Level 1

Like

1 like

Total Posts

5 posts

Correct reply

1 solution
Top badges earned
Boost 1
Affirm 1
View profile

Avatar
Boost 1
Level 1
vinayk70574604
Level 1

Like

1 like

Total Posts

5 posts

Correct reply

1 solution
Top badges earned
Boost 1
Affirm 1
View profile
vinayk70574604
Level 1

14-03-2017

Ah ok, you are using type="date" (the first property of your datepicker) this is what i meant.

I see your problem, you are using just type=date but by default this is storing in date-time format and thats why the dialog is not able to display the value.

2 Solutions-

1. If you want to retain type="date", have the additional property storedValue something like storedValue="YYYY-MM-DD" make sure you are not specifying time

2. change type="datetime", you don't need to specify the storedValue property in this case, and this lets you specify the time too.

Observe the content node for the stored value. You can use the properties accordingly for display purpose.