struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <>
Subject Re: Please Need help how to select the chosen elements
Date Wed, 06 Aug 2014 10:52:49 GMT
> Thank you Christoph for reply
> In fact, when I choose these elements from the drop-down list, I 
> save them in the database.
> After I go to an other page And I do something next I return to the 
> first one but the éléments are not selected in the drop-down list 
> but they are realy savez in the database And I want that they apear 
> as selected items.
> Thank you
> Regards
> Amine

Okay, now I understand your question (hopefully)

In plain HTML the selected <option> tag needs the attribute selected:
<option selected="selected">...</option> 

With struts2 tags you can do this:


Your action must provide getters for color and colors. While color is the 
selected value from DB and colors is the whole list of items.



This Email was scanned by Sophos Anti Virus

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message