Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

how to retrieve value from cq widget of type textfield?

Avatar

Level 9

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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

View solution in original post

3 Replies

Avatar

Level 9

smacdonald2008 wrote...

Take a look at this community content:

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

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?

Avatar

Correct answer by
Employee

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