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 :

problème xhtml et composant personnalisé défini dans un tld


Sujet :

JSF Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Août 2006
    Messages
    43
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 43
    Par défaut problème xhtml et composant personnalisé défini dans un tld
    Salut,

    J'ai creé un composant bouton radio personnalisé.
    je l'ai utilisé dans une page jsp et il a bien marché tandis que dans une page xhtml le composant ne s'affiche pas.
    je ne vois pas le problème!!!!!
    voici le code de la page tld:
    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
     
    <?xml version="1.0" encoding="UTF-8" ?>
     
    <!DOCTYPE taglib
            PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
            "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
     
     <taglib>
       <!-- ============== Tag Library Description Elements ============= -->
       <tlib-version>0.03</tlib-version>
       <jsp-version>1.2</jsp-version>
       <short-name>Custom JavaServerFaces Framework Tag Library</short-name>
       <uri>http://www.srijeeb.com/jsf/tags-html</uri> 
        <tag>
    	<name>radioButton</name>
    	<tag-class>com.srijeeb.jsf.tags.HTMLCustomSelectOneRadioTag</tag-class>
    	<body-content>empty</body-content>   
    	<attribute>
    		<name>name</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>overrideName</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>id</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>value</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>styleClass</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>style</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>disabled</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>rendered</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>Boolean</type>
    	</attribute>
    	<attribute>
    		<name>itemLabel</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>	
    	<attribute>
    		<name>itemValue</name>
    		<required>true</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>onClick</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>onMouseOver</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>onMouseOut</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>onFocus</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
    	<attribute>
    		<name>onBlur</name>
    		<required>false</required>
    		<rtexprvalue>false</rtexprvalue>
    		<type>String</type>
    	</attribute>
       </tag>
     </taglib>
    Voici celui de la page xhtml!!!!
    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
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:custom="/WEB-INF/my_custom_tags.tld">
     
    	<ui:composition >
    	<f:view>
    	<h:form id="testRadioForm">
     
    		<h:dataTable id="mySampleTable3"
    		   value="#{myBackingBean.sampleTable3}"
    		   	 headerClass="tableHeaderStyle"
    		   	 columnClasses="columnNameStyle,columnExcellentStyle,columnGoodStyle,columnAverageStyle,columnPoorStyle"
    		     var="item"
    		     width="100%"
    		     border="1"
    		     first="0">
    			<f:facet name="header">
    				<h:panelGrid id="gridHeader3" columns="1" width="100%" >
    					<h:outputText id="outputText3" value="Radios grouped in row(With our custom tag)"></h:outputText>
    				</h:panelGrid>
    			</f:facet>
    		   <h:column>
    		      <f:facet name="header">
    		         <h:outputText value="Emp Name" />
    		      </f:facet>
    			  <h:outputText id="empName" value="#{item.empName}"/>
    		   </h:column>
    		   <h:column>
    		      <f:facet name="header">
    		         <h:outputText value="Excellent" />
    		      </f:facet>
    			  <custom:radioButton id="myRadioId2"
    			  						name="myRadioRow"
    			  						value="#{item.radAns}"
    			  						itemValue="E" />
    		   </h:column>
    		   <h:column>
    		      <f:facet name="header">
    		         <h:outputText value="Good" />
    		      </f:facet>
    			  <custom:radioButton id="myRadioId3"
    			  						name="myRadioRow"
    			  						value="#{item.radAns}"
    			  						itemValue="G" />
    		   </h:column>
    		   <h:column>
    		      <f:facet name="header">
    		         <h:outputText value="Average" />
    		      </f:facet>
    			  <custom:radioButton id="myRadioId4"
    			  						name="myRadioRow"
    			  						value="#{item.radAns}"
    			  						itemValue="A" />
    		   </h:column>
    		   <h:column>
    		      <f:facet name="header">
    		         <h:outputText value="Poor" />
    		      </f:facet>
    			  <custom:radioButton id="myRadioId5"
    			  						name="myRadioRow"
    			  						value="#{item.radAns}"
    			  						itemValue="P" />
    		   </h:column>
    		</h:dataTable>
    		<h:panelGrid id="buttonGrid" columns="1" width="100%">
    			<h:commandButton id="btnTest" action="#{myBackingBean.executeTest}" value="Test It"/>
    		</h:panelGrid>
    		<rich:separator/>
    		<h:panelGrid id="resultGridHeader" columns="1" width="100%">
    			<h:outputText value="RESULT"></h:outputText>
    		</h:panelGrid>
    		<rich:separator/>
    		<h:panelGrid id="resultGrid2" columns="1" width="100%">
    			<h:outputText value="#{myBackingBean.resultOfSecondTable}"></h:outputText>
    		</h:panelGrid>
     
     
     
    </h:form>
    </f:view>
    	</ui:composition>
     
    </html>

    Est ce que quelqu'un a une idée.
    Merci d'avance!!!!!

  2. #2
    Membre averti
    Inscrit en
    Août 2006
    Messages
    43
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 43
    Par défaut
    je vais expliquer d'avantage.
    J'ai un composant personnalisé jsf(selectoneradio qui peut etre utilisé dans un datatable).
    Je veux utiliser ce composant dans une page xhtml mais le composant ne s'affiche pas.


    S'il vous plait est ce que quelqu'un a une idée.
    Merci d'avance.

  3. #3
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    dans les pages xhtml, c'est facelets qui travaille normalement, facelet n'utilise pas les tld mais a son propre système de tag. Tu dois donc configurer une "taglib" facelet aussi. les taglib sont à stocker dans META-INF/*.taglib.xml

  4. #4
    Membre averti
    Inscrit en
    Août 2006
    Messages
    43
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 43
    Par défaut
    Salut,


    Merci pour ton aide, mais est ce qu'il faut juste remplacer la page tld par la page tag.xml????

    Merci d'avance.

  5. #5
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    non, facelet a son propre format pour définir ses taglibs.

    tu trouvera un post à ce sujet ici: http://www.developpez.net/forums/d34...tom-component/

  6. #6
    Invité de passage
    Inscrit en
    Avril 2009
    Messages
    1
    Détails du profil
    Informations forums :
    Inscription : Avril 2009
    Messages : 1
    Par défaut Solution
    Bonjour, j'utilise exactement le même composant en facelets et j'aimerais savoir si vous avez trouvé la solution finale!

    Merci,

    Alex.

Discussions similaires

  1. Réponses: 2
    Dernier message: 27/10/2009, 17h13
  2. Problème d'instanciation d'une structure défini dans un OCX
    Par aikidoka13 dans le forum VB 6 et antérieur
    Réponses: 1
    Dernier message: 27/04/2009, 15h07
  3. Ajouter un composant personnalisé dans la boite à outils
    Par soad dans le forum Windows Presentation Foundation
    Réponses: 3
    Dernier message: 26/01/2009, 20h05
  4. Problème sur le composant (ToolButton) dans une TToolBar
    Par 21247692 dans le forum Composants VCL
    Réponses: 3
    Dernier message: 16/04/2008, 13h03
  5. Réponses: 3
    Dernier message: 18/01/2008, 16h54

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