Hello,

I'm working on struts and hibernate. J'ai une tache qui est affectée à un
utilisateur.

I have a Actionform named Task.

Private Integer code ;
Private String codeus ; // Login of user
Private String libelle;


I have also a POJO Task.

Private Integer code;
Private User user;  // Many-to-one relation with user Class.
Private String libelle;


And I have a action class which gets back my user's list to show it in a
combobox in my jsp when i create a task. 

Code :
<html:select property="codeus">
   <html:options property="codeus" collection="lesUtilisateurs"
labelProperty="nom">
</html:select>

The code above allows me to show a comobox with the names of my users. The
parameter sent to get back the user is codeus. Up to there, it works. After
recording in my database, my problem is to show the user allocated to the
task in modify.jsp.

If i do

Code :
<html:select property="codeus" name="tache">
   <html:options property="codeus" collection="lesUtilisateurs"
labelProperty="nom">
</html:select>

my user recording in database is not selected by default.

If I do 

<html:select property="utilisateur.codeus" name="tache">
   <html:options property="codeus" collection="lesUtilisateurs"
labelProperty="nom">
</html:select>

My user is selected, but the actionform doesn't recognize my attribute
utilisateur.codeus because it wants codeus

Does it mean that my actionform must have utilisateur.codeus as attribute ?

Thanks for your help.

David Douillard
Mairie de Niort
Direction des Systèmes d'Informations et de télécommunications 
Tél : 05.49.78.74.47 
Fax : 05.49.78.73.73 
http://www.vivre-a-niort.com <http://www.vivre-a-niort.com/> 


Reply via email to