Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Change event for a date time field does not work when used in a multi field

Avatar

Level 2

Hi All,

I have a multi field which contains a number of fields out of which one is a datetime field which is declared as below

this.dateField = new CQ.Ext.form.DateField({
                width: 300,
                allowBlank: false,
                hideTime:true,
                listeners: {
                    change: {
                        scope:this,
                        fn:this.updateHidden
                    },
                    dialogclose: {
                    scope: this,
                    fn: this.updateHidden
                }
                }
            });

The field renders correctly, however when I try to change the date, the date change does not happen and it retrieves the old date value. This is only happening when I am using the date field. Am I missing something here?

 

Thanks,

Ravi

1 Accepted Solution

Avatar

Correct answer by
Level 10

What version of CQ are you using -- are you coding your date time field in a custom xtype?

If you create a custom xtype that defines a CQ.Ext.form.DateField -- when you make a change - its handler will be fired. For those reading this thread and wondering how to create an AEM custom xtype -- see:

http://helpx.adobe.com/experience-manager/using/creating-custom-xtype.html

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

What version of CQ are you using -- are you coding your date time field in a custom xtype?

If you create a custom xtype that defines a CQ.Ext.form.DateField -- when you make a change - its handler will be fired. For those reading this thread and wondering how to create an AEM custom xtype -- see:

http://helpx.adobe.com/experience-manager/using/creating-custom-xtype.html

Avatar

Level 2

Hey, 

I am using CQ 5.6 and have tried with the DateField xtype as well but it still does not work. I have used the same procedure that was given in the link to create my custom xtype. However, only difference is that I have tried to place the custom xtype in a multi field.

Also, here are few things that look strange

there is an xtype named datetime, but I do not find the corresponding code for it in CQ. All I can find is the datefield.js which is for the xtype "datefield" .

Thanks,

Ravi

Avatar

Level 10

I will look into getting a functioning code example for you. I will post an update.