Hi, I have a select where a user can select an option.

// Select exception
exception = new Select("exception", true);
exception.setMultiple(false);
exception.setDataProvider(new DataProvider() {
public List<Option> getData() {
List<Option> options = new ArrayList<Option>();
List<PrintProviderErrorMockEnt> allErrors = new
ArrayList<PrintProviderErrorMockEnt>();
try {
allErrors = printProviderMockSBBeanLocal.getErrors();
for (Iterator iterator = allErrors.iterator(); iterator.hasNext();) {
PrintProviderErrorMockEnt printProviderErrorMockEnt =
(PrintProviderErrorMockEnt) iterator.next();
options.add(new Option(printProviderErrorMockEnt.getId(),
printProviderErrorMockEnt.getErrorCode() + " : "
+ printProviderErrorMockEnt.getName()));
}
} catch (SystemException e) {
// TODO show errorpage
logger.error(e.getMessage(), e);
}
return options;
}
});
exception.setDefaultOption(Option.EMPTY_OPTION);


When the user has selected a value and presses the submit button the value
is stored in database.
This same page is used when the user wants to edit the values....

How do I set the select control, to have the option selected, that the user
did select previous when the wants the edit it...

Kris

Reply via email to