How to set "defaultValue" for xtype tags. | Community
Skip to main content
Level 2
October 16, 2015
Solved

How to set "defaultValue" for xtype tags.

  • October 16, 2015
  • 1 reply
  • 924 views

Hi, I am not abel to set defaultValue to xtype tags. Can any of one have idea please help me.

I tried with defaultValue property is not working.

And addTag method is adding tags but iam getting validation error. Please go through attachment.

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

Is the xtype in your pic a CQ.Ext.form.ComboBox or a CQ.wcm.ContentFinder

If you are using a combo box in a custom xtype - you can use code like:


// create the combo instance
var combo = new CQ.Ext.form.ComboBox({
    typeAhead: true,
    triggerAction: 'all',
    lazyRender:true,
    mode: 'local',
    store: new CQ.Ext.data.ArrayStore({
        id: 0,
        fields: [
            'myId',
            'displayText'
        ],
        data: [[1, 'item1'], [2, 'item2']]
    }),
    valueField: 'myId',
    displayField: 'displayText'
});


The Combo Box API has a default value setting to: 

[img]Combobox.png[/img]

We have an article on how to use this ComboBox API within a custom xtype:

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

However - there is no such API that maps to an "xtype tag". You can get a value from a combo box in a custom xtype. Then you can use the AEM TagManager API and create a tag based on that value. See these docs:

http://wem.help.adobe.com/enterprise/en_US/10-0/wem/developing/tagging.html

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

Is the xtype in your pic a CQ.Ext.form.ComboBox or a CQ.wcm.ContentFinder

If you are using a combo box in a custom xtype - you can use code like:


// create the combo instance
var combo = new CQ.Ext.form.ComboBox({
    typeAhead: true,
    triggerAction: 'all',
    lazyRender:true,
    mode: 'local',
    store: new CQ.Ext.data.ArrayStore({
        id: 0,
        fields: [
            'myId',
            'displayText'
        ],
        data: [[1, 'item1'], [2, 'item2']]
    }),
    valueField: 'myId',
    displayField: 'displayText'
});


The Combo Box API has a default value setting to: 

[img]Combobox.png[/img]

We have an article on how to use this ComboBox API within a custom xtype:

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

However - there is no such API that maps to an "xtype tag". You can get a value from a combo box in a custom xtype. Then you can use the AEM TagManager API and create a tag based on that value. See these docs:

http://wem.help.adobe.com/enterprise/en_US/10-0/wem/developing/tagging.html