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 lors du chargement de la page


Sujet :

JSF Java

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juin 2009
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2009
    Messages : 12
    Points : 9
    Points
    9
    Par défaut Problème lors du chargement de la page
    Bonjour à tous,

    Je souhaite cacher un panel au chargement de la page et le rendre visible que lorsque je clique sur le lien "ouvrir" j'ai associé un évènement onload mais ne marche pas!!!!
    voilà le code:

    ***********************CODE************************

    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
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:sf="http://www.springframework.org/tags/faces">
     
    <style type="text/css">
     
    .userPanel {
         width:200px;
         height: 100px;
         float:right;
         border-color:#FFFFFF;
        }
     
    </style>
     
     
     
    <rich:panel styleClass="userPanel" id="userPanel">
        <a4j:commandLink> ouvrir </a4j:commandLink>
    <rich:effect event="onclick" type="Appear"  targetId="userDetailPanel" />
     
    <rich:panel id="userDetailPanel">
    <a4j:commandLink action="RechercherTaches">taches
    </aj:commandLink><br/>
    <a4j:commandLink action="deconnection"> Déconnexion </a4j:commandLink>
    <a4j:commandLink> Fermer 
    <rich:effect event="onclick" type="Fade"  for="userDetailPanel" />
    </a4j:commandLink>
    <rich:effect  event="onload" for="userDetailPanel" type="Fade" />
    </rich:panel>
     
    </rich:panel>
    **************FIN****************


    Merci d'avance

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 42
    Points : 46
    Points
    46
    Par défaut
    A la place de <rich:panel> tu peut utiliser le composant <h:panelGrid> qui contient le paramètre booléen rendered, <h:panelGrid rendered="" ... il te permet de caché le panel

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juin 2009
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2009
    Messages : 12
    Points : 9
    Points
    9
    Par défaut la solution
    j'ai utilisé le composant <rich:panel > et le booléen rendered qui prend une valeur True ou False selon l'action déclenché( l'action "afficherPanelTaches" met la variable afficheDetailPanelTaches a true et l'action "masquerPanelTaches" la met a false )et ça marche!!!
    voilà le nouveau code

    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
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:sf="http://www.springframework.org/tags/faces">
     
        <rich:panel styleClass="userPanel fondBandeau" id="userPanel" >
            <a4j:commandLink action="afficherPanelTaches" reRender="userPanel">
                <img title="Cliquer pour avoir plus de détails"  
                    src="${request.contextPath}/resources/resources/images/icons/login.gif"
                    height="40" width="50" />
            </a4j:commandLink>
            <rich:panel  id="userDetailPanel" styleClass="userDetailPanel" rendered="#{afficheDetailPanelTaches}">
                <h:outputText value=" #{sessionScope.SPRING_SECURITY_LAST_USERNAME} " />
                <br />
                <a4j:commandLink action="RechercherTaches">
                    Tâches 
                </a4j:commandLink>
                <br />
                <a4j:commandLink action="deconnection"> 
                    Déconnexion 
                </a4j:commandLink>
                <br />
                <br />
                <a4j:commandLink action="masquerPanelTaches" reRender="userPanel">
                    Fermer
                </a4j:commandLink>
            </rich:panel>
     
        </rich:panel>
     
    </ui:composition>


    Merci

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

Discussions similaires

  1. Réponses: 2
    Dernier message: 25/02/2011, 10h39
  2. problème lors de chargement de la page
    Par sonsonsana dans le forum Servlets/JSP
    Réponses: 1
    Dernier message: 03/05/2010, 10h56
  3. Réponses: 6
    Dernier message: 22/06/2006, 22h57
  4. Réponses: 3
    Dernier message: 08/12/2004, 21h11
  5. Problème lors du chargement
    Par carlito dans le forum Flash
    Réponses: 26
    Dernier message: 06/01/2004, 15h21

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