Expand my Community achievements bar.

SOLVED

How to set Default Time in Touch UI Dailog

Avatar

Level 4

Hi All,

    we have used date time xtype in Classic UI to get today date as default date using property defaultValue=now.

    But we are not able to set the default value in Touch UI using defaultValue=now

    Could you help us in assisting which property needs to be used for Touch UI.

    We are using slingResouceType as granite/ui/components/foundation/form/datepicker for Touch UI.

Regards

1 Accepted Solution

Avatar

Correct answer by
Level 10

You need to code using JQuery with the following Granite data type: 

https://docs.adobe.com/docs/en/aem/6-0/develop/ref/granite-ui/api/jcr_root/libs/granite/ui/component...

Set the value property. 

To see an example of coding with this data type - see this blog. 

http://experience-aem.blogspot.ca/2015/12/aem-61-touchui-date-picker-validator-comparing-two-dialog-...

This is a demo package too that you can install and look at. 

Hope this helps

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

You need to code using JQuery with the following Granite data type: 

https://docs.adobe.com/docs/en/aem/6-0/develop/ref/granite-ui/api/jcr_root/libs/granite/ui/component...

Set the value property. 

To see an example of coding with this data type - see this blog. 

http://experience-aem.blogspot.ca/2015/12/aem-61-touchui-date-picker-validator-comparing-two-dialog-...

This is a demo package too that you can install and look at. 

Hope this helps

Avatar

Administrator

Hi 

Couple of days back we had same question:

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// use a component granite/ui/components/coral/foundation/form/datepicker instead of granite/ui/components/foundation/form/datepicker..

The only difference between your question and old post was their default date was needed and here time.

 

Other option is what Scott has mentioned:-

Create a custom component using Jquery and get the current value from it. To see an example of coding with this data type - see this blog. 

http://experience-aem.blogspot.ca/2015/12/aem-61-touchui-date-picker-validator-comparing-two-dialog-...

This is a demo package too that you can install and look at. 

 

I hope this could help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 4

@kautuk_sahni I am having same issue. There is date field and want to set Default value as System date when user creates the article page. We are using this date field for sorting purpose. Any help here. Above links are not working for me.

Avatar

Level 2

Hi @supriya-hande - We have a similar requirement. Please share if there are any details identified.

Thanks.