Hi All,
I am a self taught
Java developer, and am very new to
Struts. I've been working on a project for a while now and have tried to refrain from asking "newbie" questions, however, there is something that has eluded me for some time, which seems to be very simply. I am trying to default selected items in a checkboxlist. I have searched this site and read the numerous similar topics where solutions have been offered. Either I am going mad, I'm making a newbie error or am missing something vital.
So I hope someone will be able to help.
To summarise. I have a checkboxlist that is displaying a list of available Locales/Languages (which is retrieved from a SQL Table). I am trying to have some of these ticked by default. This is what I have:
userManager.jsp
This currently displays 4 checkbox's, none of which are ticked. And the HTML looks like this:
userManager - generated HTML
While they are not visible above, the "values" of the checkbox items above do indeed cotnain an underscore, so en_FI, en_DK, en_NO for example.
The function getLanguagesSelected is as follows (currently hard coded, just to get this to work):
UserActions.java
Just to clarify, I have put a breakpoint in the above function and I know it is being called. So why doesn't it select the two checkboxes in my
String Array?
Thanks in advance for any help you can offer.