IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

[JSF 1.2] erreur : Value of tag <selectItems> attribute is incorrect.


Sujet :

JSF Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre très actif
    Avatar de lionceau
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    148
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2008
    Messages : 148
    Par défaut [JSF 1.2] erreur : Value of tag <selectItems> attribute is incorrect.
    Bonjour,

    J'ai cette erreur , je ne comprend pas pourquoi la syntaxe du selectItems est mauvaise, quelqu'un peut il m'expliquer d'où viens l'ereur ?
    An Error Occurred:
    Value of tag <selectItems> attribute is incorrect.
    +- Stack Trace
    java.lang.IllegalArgumentException: Value of tag <selectItems> attribute is incorrect.
    at org.ajax4jsf.util.SelectUtils.getSelectItems(SelectUtils.java:101)
    at org.richfaces.renderkit.PickListRenderer.getConvertedItems(PickListRenderer.java:511)
    at org.richfaces.renderkit.html.PickListRendererGen.doEncodeChildren(PickListRendererGen.java:283)
    at org.richfaces.renderkit.html.PickListRendererGen.doEncodeChildren(PickListRendererGen.java:264)
    at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:840)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:840)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
    at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
    at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
    at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
    at java.lang.Thread.run(Thread.java:662)


    Pickbean.java
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    package com.applications.gestioncs.administration;
     
    import java.util.List;
     
    import javax.faces.model.SelectItem;
     
    /**
     * 
     * 
     */
    public class PickBean {
    	/* Variable pour le formulaire pour la gestion des droits du profil*/
    	private List<SelectItem> listValues;
    	private List<SelectItem> sourceList;
     
     
    	/* #################### listValues #################### */
        /**
         * Méthode permettant d'afficher la liste des champs pour le formulaire
         * à la création du bean.
         * 
         * @return listValues
         */
    	public List<SelectItem> getListValues()	{
    		return listValues;
    	}
    	public void setListValues(List<SelectItem> listval )	{
    		 listValues=listval;
    	}
    	/* #################### sourceList #################### */
        /**
         * Méthode permettant d'afficher la liste des champs de réponse pour le formulaire
         *  
         *  @return sourceList
         */
    	public List<SelectItem> getSourceList()	{
    		return sourceList;
    	}
    	public void setSourceList(List<SelectItem> srcList )	{
    		sourceList=srcList;
    	}
    }

    gestion-profils.xhtm :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <html	xmlns="http://www.w3.org/1999/xhtml"
    		xmlns:h="http://java.sun.com/jsf/html"
    		xmlns:ui="http://java.sun.com/jsf/facelets"
    		xmlns:f="http://java.sun.com/jsf/core"
            xmlns:rich="http://richfaces.org/rich"
            xmlns:a4j="http://richfaces.org/a4j">
        <head></head>
        <body>
    		<ui:composition template="/WEB-INF/templates/templateModuleAdministration.xhtml">
    			<!-- CSS -->
    			<ui:define name="cssFilesMod">
    				<link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/resources/css/administration/profils.css" />
    			</ui:define>
     
    			<!-- Corps du module -->
    			<ui:define name="corpsModule">
    				<fieldset>
    					<legend>Créer un profil</legend>
    					<div class="afficher">
    						<h:outputLabel for="utiliserProfilExistant" value="Utiliser un profil existant :"/>
    						<h:selectOneRadio id="utiliserProfilExistant" value="#" styleClass="affichInlineBlock">
    							<f:selectItem itemValue="1" itemLabel="Oui" />
    							<f:selectItem itemValue="0" itemLabel="Non" noSelectionOption="true" />
    						</h:selectOneRadio>
     
    						<h:form id="rechercheCreationProfil">
    							<h:outputLabel for="profil" value="Profil : " />
    							<h:selectOneMenu id="profil" >
    								<f:selectItem itemValue="key1" itemLabel="Utilisateur" noSelectionOption="true" />
    								<f:selectItem itemValue="key2" itemLabel="Validateur"/>
    								<f:selectItem itemValue="key3" itemLabel="Gestionaire"/>
    								<f:selectItem itemValue="key4" itemLabel="Administrateur"/>
    								<f:selectItem itemValue="key5" itemLabel="Super Administrateur"/>
    							</h:selectOneMenu>
    							<h:commandButton id="choisir" action="#" value="Utiliser" />
    						</h:form>
    						<hr/>
     
    						<h:form id="creationProfil">
    							<table>
    								<thead></thead>
    								<tfoot></tfoot>
    								<tbody>
    									<tr><td><h:outputLabel for="intitule" value="Intitulé :" /></td><td><h:inputText id="intitule" required="true" size="30" alt="Intitulé du profil."/></td></tr>
    									<tr><td><h:outputLabel for="description" value="Description :" /></td><td><h:inputTextarea id="description" required="false" cols="27" rows="2" /></td></tr>
    								</tbody>
    							</table>
    							<h:outputLabel for="droitsDispos" value="Droits disponibles" />
     
    						<rich:pickList value="#{pickBean.listValues}">
    						    <f:facet name="copyAllControl">
    						        <h:commandButton value="#{pickBean.copyAllLabel}" />
    						    </f:facet>
    						    <f:facet name="copyControl">
    						        <h:commandButton value="#{pickBean.copyLabel}" />
    						    </f:facet>
    						    <f:facet name="removeControl">
    						        <h:commandButton value="#{pickBean.removeLabel}" />
    						    </f:facet>
    						    <f:facet name="removeAllControl">
    						        <h:commandButton value="#{pickBean.removeAllLabel}" />
    						    </f:facet>
    								<f:selectItem itemValue="key1" itemLabel="Lire" />
    								<f:selectItem itemValue="key2" itemLabel="Modifier" />
    								<f:selectItem itemValue="key3" itemLabel="Valider" />
    								<f:selectItem itemValue="key4" itemLabel="Supprimer" />
    								<f:selectItem itemValue="key5" itemLabel="Supprimer et Modifier les autres profils" />
    						        <f:selectItems value="#{pickBean.sourceList}"/>
    						</rich:pickList>
     
     
    			<!--  before 
    							<h:selectManyListbox id="droitsDispos" size="10" >
    								<f:selectItem itemValue="key1" itemLabel="Lire" />
    								<f:selectItem itemValue="key2" itemLabel="Modifier" />
    								<f:selectItem itemValue="key3" itemLabel="Valider" />
    								<f:selectItem itemValue="key4" itemLabel="Supprimer" />
    								<f:selectItem itemValue="key5" itemLabel="Supprimer et Modifier les autres profils" />
    							</h:selectManyListbox>
    			-->
    							<h:commandButton id="ajouterDroit" image="#{facesContext.externalContext.requestContextPath}/resources/images/administration/fleche_droite.png" alt="Bouton d'ajout de droit" />
    							<h:commandButton id="supprimerDroit" image="#{facesContext.externalContext.requestContextPath}/resources/images/administration/fleche_gauche.png" alt="Bouton de retrait de droit" />
    							<h:outputLabel for="droitsChoisis" value="Droits choisis" />
    							<h:selectManyListbox id="droitsChoisis" size="10" >
    							</h:selectManyListbox>
     
    							<br/>
    							<h:messages id="msgCreation" />
    							<h:commandButton id="creerProfil" action="#" value="Créer le profil" alt="Bouton de création du profil" />
    						</h:form>
    					</div>
    				</fieldset>
     
    				<fieldset>
    					<legend>Modifier d'un profil</legend>
    					<div class="afficher">
    					</div>
    				</fieldset>
     
    				<fieldset>
    					<legend>Autoriser l'attribution / Supprimer un profil</legend>
    					<div class="afficher">
    						<h:form id="activeRecherche" >
    							<h:outputLabel for="champRecherche" value="Choix du profil à traiter : " />
    							<h:selectOneMenu id="champRecherche" value="#" hideNoSelectionOption="true">
    								<f:selectItem itemValue="" itemLabel="" noSelectionOption="true" />
    								<f:selectItem itemValue="key1" itemLabel="Utilisateur"/>
    								<f:selectItem itemValue="key2" itemLabel="Validateur"/>
    								<f:selectItem itemValue="key3" itemLabel="Gestionaire"/>
    								<f:selectItem itemValue="key4" itemLabel="Administrateur"/>
    								<f:selectItem itemValue="key5" itemLabel="Super Administrateur"/>
    							</h:selectOneMenu>
    							<h:commandButton id="choisir" action="#" value="Choisir"/>
    						</h:form>
    						<hr/>
    						<h:form id="activationProfil">
    							<table>
    								<thead></thead>
    								<tfoot></tfoot>
    								<tbody>
    									<tr><td><h:outputLabel for="intitule" value="Intitulé :" /></td><td><h:outputText id="nom" value="l'intitulé du profil."/></td></tr>
    									<tr><td><h:outputLabel for="description" value="Description :"/></td><td><h:outputText id="prenom" value="la description du profil."/></td></tr>
    									<tr><td><h:outputLabel for="droits" value="Droits :"/></td>
    										<td>
    											<h:selectManyListbox id="droits" size="10" >
    								<f:selectItem itemValue="key1" itemLabel="Lire" />
    								<f:selectItem itemValue="key2" itemLabel="Modifier" />
    								<f:selectItem itemValue="key3" itemLabel="Valider" />
    								<f:selectItem itemValue="key4" itemLabel="Supprimer" />
    								<f:selectItem itemValue="key5" itemLabel="Supprimer et Modifier les autres profils" />
    											</h:selectManyListbox>
    										</td>
    									</tr>
    								</tbody>
    							</table>
    							<h:message for="activationProfil" />
    							<h:commandButton id="activer" action="#" value="Autoriser l'attibution du profil" alt="Bouton d'activation du profil" />
    							<h:commandButton id="desactiver" action="#" value="Interdire l'attibution du profil" alt="Bouton de désactivation du profil" />
    							<h:commandButton id="supprimer" action="#" value="Supprimer le profil" alt="Bouton de suppression du profil" />
    						</h:form>
    					</div>
    				</fieldset>
    			</ui:define>
     
    			<ui:define name="javascriptModule">
    				<script src="#{facesContext.externalContext.requestContextPath}/resources/javascript/genericFunctions.js" />
    				<script src="#{facesContext.externalContext.requestContextPath}/resources/javascript/administration/gestionProfils.js" />
    			</ui:define>
    		</ui:composition>
        </body>
    </html>


    Merci pour vos conseils et votre aide,


    Lionceau

  2. #2
    Membre très actif
    Avatar de lionceau
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    148
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2008
    Messages : 148
    Par défaut
    Pour réalisé le code ci dessus , je me suis inspiré de ce tuto : http://docs.jboss.org/richfaces/late..._pickList.html

  3. #3
    Membre très actif
    Avatar de lionceau
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    148
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2008
    Messages : 148
    Par défaut
    solution trouvé , il fallait que je mette ceci dans le bean :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
     
    <?xml version="1.0" encoding="UTF-8"?>
     
    <faces-config
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
        version="1.2">
     
        <!-- ==================== MANAGED-BEANS ==================== -->
    	<managed-bean>
    		<description>
    			Ce bean est utilisé pour la classe PickBean, ce bean nous sert pour la gestion des droits. 
    		</description>
    		<managed-bean-name>pickBean</managed-bean-name>
    		<managed-bean-class>com.applications.gestioncs.administration.PickBean</managed-bean-class>
    		<managed-bean-scope>request</managed-bean-scope>
    		<managed-property>
    			<property-name>listValues</property-name>
    			<property-class>java.util.ArrayList</property-class>
    			<list-entries>
    				<value-class>java.lang.String</value-class>
    			</list-entries>
    		</managed-property>
    		<managed-property>
    			<property-name>sourceList</property-name>
    			<property-class>java.util.ArrayList</property-class>
    			<list-entries>
    				<value-class>javax.faces.model.SelectItem</value-class>
    			</list-entries>
    		</managed-property>
    	</managed-bean>
     
    	<!-- ==================== NAVIGATION RULES ==================== -->
     
    	<!-- ========== FROM : module conges ========== -->
    	<navigation-rule>
    <!--		<description>Règles de navigation à l'intérieur du module de congés</description>
    		<from-view-id>/application/conges/*</from-view-id>-->
    	</navigation-rule>
     
     
    </faces-config>

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [hibernate][netbeans6][jsf]message d'erreur JNDI "\?\?\?\?"
    Par liquideshark dans le forum NetBeans
    Réponses: 2
    Dernier message: 15/07/2009, 22h07
  2. Erreur 'value violates unique constraint'
    Par miniBob dans le forum PostgreSQL
    Réponses: 5
    Dernier message: 23/06/2009, 20h06
  3. Erreur Unable to tag SCM lors du release:prepare
    Par jprsoft dans le forum Maven
    Réponses: 2
    Dernier message: 18/02/2009, 17h37
  4. JSF et CSS, mauvaise association des tags
    Par whorian dans le forum JSF
    Réponses: 1
    Dernier message: 15/01/2008, 13h32
  5. Réponses: 19
    Dernier message: 12/11/2007, 09h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo