I want to replace "choose one" option in drop down choice with other String "successfully occured" and I dont want to show list item to set the default.
DropDownChoice<Person> customer = new DropDownChoice<Person>(
"customer", new PropertyModel<Person>(customermodel, "customer"),list, new ChoiceRenderer<Person>("name", "id"));
The best way to do this is to put the definition
customer.null=successfully occured
in a properties file associated with the form or page containing the choice.
The properties file can also be localized so that what's shown depends on the locale.
For me I had to do following to get this done.
customer.setNullValid(true);
Then created a file named "HomePage.properties" (I added the drop down to HomePage)
set the null text in the .properties file as bellow.
nullValid=Choose one..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With