-
1 May 2012 4:13 PM #1
Unanswered: How to make the Ext.Msg.prompt input field a password?
Unanswered: How to make the Ext.Msg.prompt input field a password?
I'm pulling my hair out trying to find out how to set the Ext.Msg.prompt input field to a password.
I can do it with a component query if I find the texfield id with the Chrome dev tools. However, the framework dynamically sets these ids, so it tends to change during the running of the application, and then breaks my code.
If anyone knows how this can be done, I'd really appreciate some help.
Tadhg
-
2 May 2012 2:40 AM #2
Really need to get to the bottom of this, please help!!
-
2 May 2012 6:40 AM #3
Can anyone out there shed some light on this? Really need to deploy my app and this is the last outstanding task. Pleeeeease help....
-
2 May 2012 9:13 AM #4Ext GWT Premium Member
- Join Date
- May 2010
- Location
- Ashburn, Virginia
- Posts
- 48
- Vote Rating
- 2
- Answers
- 8
For the prompt config property you can just pass in an type of password and it should become a password field.
This should create it as a password field. If this does not work, then you will have to use the component query possibly providing a unique selector to the message box on creation that you will be able to select from.Code:config:{ prompt:{ xtype:'passwordfield' } }
-
2 May 2012 10:02 AM #5
Hi Darren, thanks for your reply, I really appreciate it. I tried a few version of your suggestion but to no avail. Here's my code, perhaps it can shed some light:
And with your suggestion:Code:var msg = Ext.Msg.prompt("Send Database contents", "Please enter the admin password", function (btn, inputValue) { if (btn == "ok") { Ext.Ajax.request({ url: 'email-database.php?password=' + inputValue }); } });
Finally I took a stab at this:Code:var msg = Ext.Msg.prompt({ title: "Email Database contents", message: "Please enter the admin password", fn: function (btn, inputValue) { if (btn == "ok") { Ext.Ajax.request({ url: 'email-database.php?password=' + inputValue }); } }, config: { prompt: { xtype: 'passwordfield' } } });
Still no joy. Any thoughts based on what I'm doing above?Code:msg.getPrompt().config.component.type = 'password';
-
2 May 2012 10:37 AM #6Ext GWT Premium Member
- Join Date
- May 2010
- Location
- Ashburn, Virginia
- Posts
- 48
- Vote Rating
- 2
- Answers
- 8
The code below will display with the password field in the application.
Code:Ext.Msg.prompt( "Email Database contents", "Please enter the admin password", function (btn, inputValue) { if (btn == "ok") { Ext.Ajax.request({ url:'email-database.php?password=' + inputValue }); } }, null, false, null, {xtype:'passwordfield'});
-
2 May 2012 11:13 AM #7
Darren you're a life saver, works like a charm! I'm kicking myself now that I understand how you did it. Thank you so much mate.
-
24 Jan 2013 7:13 AM #8
Hola
Hola
Gracias me funciono con el ultimo codigo



Reply With Quote