06-17-2011 03:07 PM
I am trying to create a dialog box that will allow me to either change address of my location or just confirm the address that appears within the dialog box by clicking ok.
Solved! Go to Solution.
06-17-2011 03:13 PM
Welcome to the forums!
What part of this task gives you trouble? Have you looked at PopupScreen and TextField (or, say, EditField) documentation?
06-17-2011 03:29 PM
06-17-2011 05:57 PM
Then take a look at the Dialog class documentation - especially add and doModal methods. You add a variation of a TextField, of course. Create a public method in your CustomDialog which extracts the text from that TextField and returns it to the caller and call it after the dialog is dismissed (doModal returns).
06-17-2011 10:20 PM
06-19-2011 12:15 AM
This is a very basic task so I don't think you will have many code examples in the knowledge book or anywhere in this forum. Try BlackBerry Manuals and Guides for Developers - especially UI Guidelines for BlackBerry Smartphones and BlackBerry Java development guides for starters.
06-22-2011 03:56 PM
06-22-2011 04:31 PM
Your post is very strangely formatted, but I can guess the approach. I'd say you are doing it the hard way, but the overall idea is correct. I suggest you add two public methods which extract username and password:
public String getUserName() {
if (userName != null) {
return userName.getText();
}
return null;
}
public String getPassword() {
if (password != null) {
return password.getText();
}
return null;
}
Call these methods once the dialog closes. Check whether the user pressed 'OK' or 'Cancel' before doing so.
06-22-2011 04:32 PM - edited 06-23-2011 12:54 PM
06-23-2011 12:53 PM