Unable to add DropDown ComboBox to LinkDialog.js | Adobe Higher Education
Skip to main content
TheRealUpWorks
Level 2
October 16, 2015
Beantwortet

Unable to add DropDown ComboBox to LinkDialog.js

  • October 16, 2015
  • 2 Antworten
  • 1002 Ansichten

I have created a LinkDialogOverride.js and need to change the default:

{ "itemId": "targetBlank", "name": "targetBlank", "xtype": "checkbox", "boxLabel": CQ.I18n.getMessage("Open in new window"), "value": "targetBlank" }

To a select dropdown or combo box. I see how it can be added to a dialog through .content.xml but not for the LinkDialog.js.  Thank you in advance.

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von Ojjis

Hi. For the dropdown you have to use the correct variables for a dropdown.
There are different forms of selection xtypes.You have the combo box, checkbox, dropdown menu and the radio buttons.
Xtype needs to be set to selection and the type of selection needs to be set to select (dropdown).
Then of course you also need to add the selectable values to that widget.

Here's a basic example with just two options:

 

this.myField = new CQ.form.Selection({ "fieldLabel": "MySelection", "name": this.componentName + "/" + selectionName, "type": "select", "ignoreData": true, "options": [{ "value": "true", "text": "Yes" },{ "value": "false", "text": "No" } ] });

Hope this will make some sense
/Johan
 

2 Antworten

Ojjis
OjjisAntwort
Level 7
October 16, 2015

Hi. For the dropdown you have to use the correct variables for a dropdown.
There are different forms of selection xtypes.You have the combo box, checkbox, dropdown menu and the radio buttons.
Xtype needs to be set to selection and the type of selection needs to be set to select (dropdown).
Then of course you also need to add the selectable values to that widget.

Here's a basic example with just two options:

 

this.myField = new CQ.form.Selection({ "fieldLabel": "MySelection", "name": this.componentName + "/" + selectionName, "type": "select", "ignoreData": true, "options": [{ "value": "true", "text": "Yes" },{ "value": "false", "text": "No" } ] });

Hope this will make some sense
/Johan
 

smacdonald2008
Level 10
October 16, 2015

All default values are set by assigning values to the using values to the xtype node. I am unclear - you have set the default value using a dialog - correct?