This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: Console Installer: promptAndGetValue and reprompt if user enters wrong value?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 13, 2013
04:43 PM
Console Installer: promptAndGetValue and reprompt if user enters wrong value?
I have a customCodeConsoleAction in which I am using the promptAndGetValue method from ConsoleUtils
I want to get the gmail account of the user. After prompting once I check to see if the gmail is a valid email address, if it is not I want to reprompt the user. This is my code. The installer is crashing when i try to call the method again.
Any ideas or other solutions?
HERE IS MY CODE:
@Override
public void executeConsoleAction() throws PreviousRequestException {
try {
promptForGoogleAccount();
} catch (PreviousRequestException e) {
cccp.setVariable("GMAIL_ACCOUNT", "");
throw new PreviousRequestException();
}
}
private void promptForGoogleAccount() throws PreviousRequestException {
ConsoleUtils cu = (ConsoleUtils) cccp.getService(ConsoleUtils.class);
String googleAccountQuestion = "Please enter your Google Email Account";
String googleAccount = cu.promptAndGetValue(googleAccountQuestion);
if (isValidGoogleAccount(googleAccount) == true) {
cccp.setVariable("GMAIL_ACCOUNT", googleAccount);
} else {
promptForGoogleAccount();
}
}
I want to get the gmail account of the user. After prompting once I check to see if the gmail is a valid email address, if it is not I want to reprompt the user. This is my code. The installer is crashing when i try to call the method again.
Any ideas or other solutions?
HERE IS MY CODE:
@Override
public void executeConsoleAction() throws PreviousRequestException {
try {
promptForGoogleAccount();
} catch (PreviousRequestException e) {
cccp.setVariable("GMAIL_ACCOUNT", "");
throw new PreviousRequestException();
}
}
private void promptForGoogleAccount() throws PreviousRequestException {
ConsoleUtils cu = (ConsoleUtils) cccp.getService(ConsoleUtils.class);
String googleAccountQuestion = "Please enter your Google Email Account";
String googleAccount = cu.promptAndGetValue(googleAccountQuestion);
if (isValidGoogleAccount(googleAccount) == true) {
cccp.setVariable("GMAIL_ACCOUNT", googleAccount);
} else {
promptForGoogleAccount();
}
}
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 13, 2013
05:52 PM
i figured it out...silly mistakes. It had to do with my boolean method