how to retrieve value from cq widget of type textfield? | Community
Skip to main content
GK-007
Level 9
October 16, 2015
Solved

how to retrieve value from cq widget of type textfield?

  • October 16, 2015
  • 3 replies
  • 1630 views

Hi all,

I have defined a simple dialog with two text boxes and one button.The action i am looking here is when i clicked on the button value entered in first text field needs to be filled in second text

field automatically.I have tried to get the value in the handler method of the button using getValue() of text field.Can some one help how to get the reference of first text field and it's entered

value.Attached sample code as well.

Thanks In Advance.

-Kishore

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 JustinEd3

Hi,

You can get to the parent panel by using btn.findParentByType("panel") and then using find("name", "title") on the panel to find the title widget.

HTH,

Justin

3 replies

GK-007
GK-007Author
Level 9
October 16, 2015

smacdonald2008 wrote...

Take a look at this community content:

http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/06/basic-cq5-code-samples.html

This may be helpful as well:

http://stackoverflow.com/questions/8710832/getting-value-of-checkbox-from-dialog

 

Thanks for the post and the above links give the information about how to retrieve in jsp.Actually my intention is retrieve in the js(DamAdmin.Actions.js) itself and manipulate them.Like New File,New Folder in DAM area i have added menu item Open Form.This form has three widgets as said above.

 "title":{

                            "fieldLabel":CQ.I18n.getMessage("Property2"),
                            "fieldSubLabel":CQ.I18n.getMessage("Optional"),
                            "fieldDescription":CQ.I18n.getMessage('It is a value of "property2"'),
                            "name":"title",
                            "allowBlank":false
                        },

"valBtn": {
                             "xtype":"button",
                             "text":"Validate P1",
                             "autoHeight":true,
                             "autoWidth":true,
                             "clickEvent":"click",
                             "scope":this,
                             "handler":function(btn)
                             {
                                //CQ.Ext.Msg.alert("clicked button name:"+btn.getText());
                                var prop1=this.getField("Prop3").getValue();
                                CQ.Ext.Msg.alert("Entered Prop1 Value:"+prop1);     
                             }

                             
                        },
               

can i get the reference of text field and entered value in  handler method of button?

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Hi,

You can get to the parent panel by using btn.findParentByType("panel") and then using find("name", "title") on the panel to find the title widget.

HTH,

Justin