RECHERCHER :
COMMUNAUTE MP
Identifiez vous ...
Devenir Membre
J'ai oublié mon MDP
DOMAINE MP
Bavardages
Langages Généraux
Langages Web
Langages DotNet
Autres langages
Dev. Jeux Video
Sécurité
Sys. Exploitation
Graphismes
Logiciels
Réseaux
Bases de données
Méthodologies
Emplois High-tech
Aide juridique
Articles juridiques
FORUM
Index des forums
Ajouter un sujet
Rechercher sujet
Contact Responsable
Devenir modérateur
CHAT MP IRC
Votre pseudo ...
Srv: irc.moteurprog.com
Chan: #MoteurProg
PARTICIPER
Plus de 3500 emplois.
Rechercher un job
Déposez votre CV
Emplois High-tech

Visiteur MP

 Problème html:select dans formulaire

Forum : JSP ET SERVLET
Sous Catégorie : Aucune
Type du sujet : Sujet Normale
FAQ : FAQ JSP ET SERVLET

SUIVI DES SUJETS PAR MAIL

SUIVI PAR MAIL INACTIF

RESOLUTION DU SUJET SUJET RESOLU
BLOQUAGE DU SUJET SUJET ACTIF
APPARTENANCE A LA FAQ N'APPARTIENT PAS A LA FAQ


POSTER UN NOUVEAU SUJET REPONDRE A CE SUJET

FORUM JSP ET SERVLET

PREMIERE PAGE

PAGE PRECEDENTE

Page précedente

Page suivante

PAGE SUIVANTE

DERNIERE PAGE
aurelius
Nouveau membre
Inscrit : 21/04/2006
Messages : 13
Message
#103714
Posté le 27/06/06 à 09:05
Bonjour à tous,

je rencontre un problème dans mon formulaire, au niveau de ma liste déroulante.

Explication, J\'envoi une liste d\'objets en paramétre et je dois afficher dans un select une propriété de cet objet.

Problème :

Il me renvoi une erreur (que lorsque j\'utilise un select, une zone de texte fonctionne).

Une partie du code de ma classe htvalpred :


public class htField { int idaprojettype; public int type; public int entier; public String date; public float reel; public boolean booleen; public String chaine; }



le code de ma classe htaprojettype :


public htAProjet_Type(AProjet_Type P){ this.id=P.getId_AProjet_Type(); this.libelle=P.getLibelle_AProjet_Type(); this.type = P.getType_Valeur(); this.idprojettype = P.getID_Projet_Type(); this.lstvp = null; System.out.println(\"nb de val pred : \" + P.getLst_ValPred().size()); if (P.getLst_ValPred().size()!=0){ System.out.println(\"attribut : \" + this.getLibelle()); System.out.println(\"il y a des valpred\"); this.lstvp = new htValPred[P.getLst_ValPred().size()]; for (int i=0; i<P.getLst_ValPred().size();i++){ htValPred htvp = new htValPred( (Valeur_Predefinie) P.getLst_ValPred().get(i)); System.out.println(htvp.getM_Id_ValPred()); this.lstvp[i]=htvp; } } }


Voici le code de mon controleur :


for (int i=0;i<PT.getLst_Aprojet_Type().size();i++){ AProjet_Type APT = new AProjet_Type(); APT = (AProjet_Type) PT.getLst_Aprojet_Type().get(i); liste_aprojet_type[i] = APT; htaprojettype[i]=new htAProjet_Type(APT); } request.setAttribute(\"LISTE_APROJET_TYPE\", htaprojettype);



Le code de mmon formulaire :



<form-bean name=\"frmprojet\" type=\"com.okaidi.workflow.vue.form.FormulaireCreationProjet\"> <form-property name=\"fields\" type=\"com.okaidi.workflow.vue.ihm.htField[]\" size=\"99\"/> <form-property name=\"libelle\" type=\"java.lang.String\" /> <form-property name=\"datedebutprojet\" type=\"java.lang.String\" /> <form-property name=\"datefinprojet\" type=\"java.lang.String\" /> <form-property name=\"idworkflow\" type=\"java.lang.String\" /> </form-bean>



Pour finir le code ma jsp :


<!-- Si le type est 4 : c\'est un string --> <logic:equal name=\"id_LISTE_APROJET_TYPE\" property=\"type\" value=\"4\"> <td width=\"30%\"><bean:write name=\"id_LISTE_APROJET_TYPE\" property=\"libelle\"/></td> <td width=\"30%\"> <logic:present name=\"id_LISTE_APROJET_TYPE\" property=\"lstvp\"> <html:select property=\"fields\" > <html:options collection=\"lstvp\" name=\"M_String\"> </html:select> </logic:present> <logic:notPresent name=\"id_LISTE_APROJET_TYPE\" property=\"lstvp\"> <html:text indexed=\"true\" name=\"fields\" style=\"font-family:Verdana;font-size:10px;\" size=\"20\" property=\"chaine\" value=\"\"/> </logic:notPresent> <html:hidden indexed=\"true\" name=\"fields\" property=\"entier\" value=\"\"/> <html:hidden indexed=\"true\" name=\"fields\" property=\"reel\" value=\"0\"/> <html:hidden indexed=\"true\" name=\"fields\" property=\"booleen\" value=\"true\"/> <html:hidden indexed=\"true\" name=\"fields\" property=\"date\" value=\"\"/> </td> </logic:equal> <!-- fin cas 4 -->

HAUT DE PAGE

PROFIL MEMBRE LUI ECRIRE 

Publicité
Inscrit : X
Messages : X
Message
#Aucun

HAUT DE PAGE

  

aurelius
Nouveau membre
Inscrit : 21/04/2006
Messages : 13
Message
#104264
Posté le 03/07/06 à 17:24
J'ai trouvé la solution.

Pour ceux que cela interresse :


<html:select indexed="true" name="fields" property="chaine" style="font-family:Verdana;font-size:10px;" value=""> <% com.okaidi.workflow.vue.ihm.htAProjet_Type APT = (com.okaidi.workflow.vue.ihm.htAProjet_Type) id_LISTE_APROJET_TYPE; for (int g=0;g<APT.getLstvp().length;g++){ com.okaidi.workflow.vue.ihm.htValPred VP = (com.okaidi.workflow.vue.ihm.htValPred) APT.getLstvp()[g]; %> <html:option value="<%=VP.getM_String() %>"> <%=VP.getM_String() %> </html:option> <% } %> </html:select>


ERREUR BBCODE SUR CE MESSAGE :
- Une balise g n'est pas fermée !



pour info, mon objet APT est un objet ayant comme propriété une liste d'objets VP, sur lesquels je désire afficher une propriété dans la liste déroulante.


Si besoins d'infos contactez-moi.

HAUT DE PAGE

PROFIL MEMBRE LUI ECRIRE 


    PAGE : [1]



.: Site Web développé par Julien Pichot et l'équipe MPWG avec www.evolvia-web.com :.