Help, I am new to Wicket...and have taken over a project with wicket version
1.4.18.
I need to add another DropDownChoice in my application.
I was able to create the add logic, but the change logic is not working as
expected.
I've been working on this for a couple of weeks, and still could not get it
working.
Following is a snip of code causing the problem:
otReasonDropDown = new DropDownChoice("otReason", new PropertyModel
(commentAndOtReason, "otReasonText"), ldm2);
otReasonDropDown.setNullValid(false);
if (commentAndOtReason.getOtReasonText() != null) {
//
otReasonDropDown.setDefaultModelObject(commentAndOtReason.getOtReasonText() +
"");
otReasonDropDown.setDefaultModelObject(commentAndOtReason.getOtReasonText() +
"");
}
String s3 = ((String) otReasonDropDown.getModelObject());
String s31 = ((String)otReasonDropDown.getDefaultModelObjectAsString());
int i3 = 1; //debugging
timeCardForm.add(otReasonDropDown);
The variable commentAndOtReason.otReasonText contains the string I want the
dropdown list to show as a default.
But the dropdown list is not showing any default, but rather an empty value.
If I select the dropdownlist, it shows the select list, including what I want
as a default value.
How do I setup DropDownChoice to have the value in
commentAndOtReason.otReasonText show as the current value(default value).
Thanks,
Steven M Nelligan
SENIOR SOFTWARE DEVELOPER