Unable to add DropDown ComboBox to LinkDialog.js | Community
Skip to main content
TheRealUpWorks
Level 2
October 16, 2015
Solved

Unable to add DropDown ComboBox to LinkDialog.js

  • October 16, 2015
  • 2 replies
  • 998 views

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.

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 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 replies

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? 

Ojjis
OjjisAccepted solution
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