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

GWT et Vaadin Java Discussion :

Problème affichage composants


Sujet :

GWT et Vaadin Java

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2007
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2007
    Messages : 200
    Par défaut Problème affichage composants
    Bonjour,
    Je débute en GWT et j'ai le plugin d'ainstallé et qui pointe sur le SDK 2.4.0
    mais j'ai l'impression que la partie dynamique n'apparait pas dans ma page html.
    Ci-dessous mon code ainsi que la capture d'écran de la structure de mon projet:

    Lili.html
    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
    <html>
    	<head>
     
    		<!--                                           -->
    		<!-- Any title is fine                         -->
    		<!--                                           -->
    		<title>Wrapper HTML for HelloGWT</title>
     
    		<!--                                           -->
    		<!-- Use normal html, such as style            -->
    		<!--                                           -->
    		<style>
    			body,td,a,div,.p{font-family:arial,sans-serif}
    			div,td{color:#000000}
    			a:link,.w,.w a:link{color:#0000cc}
    			a:visited{color:#551a8b}
    			a:active{color:#ff0000}
    		</style>
     
    		<!--                                           -->
    		<!-- The module reference below is the link    -->
    		<!-- between html and your Web Toolkit module  -->		
    		<!--                                           -->
    		<meta name='gwt:module' content='com.mafanta.test.client.Lili'>
     
    	</head>
     
    	<!--                                           -->
    	<!-- The body can have arbitrary html, or      -->
    	<!-- you can leave the body empty if you want  -->
    	<!-- to create a completely dynamic ui         -->
    	<!--                                           -->
    	<body>
     
    		<!--                                            -->
    		<!-- This script is required bootstrap stuff.   -->
    		<!-- You can put it in the HEAD, but startup    -->
    		<!-- is slightly faster if you include it here. -->
    		<!--                                            -->
    		<script language="javascript" src="gwt.js"></script>
     
    		<!-- OPTIONAL: include this if you want history support -->
    		<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
     
    		<h1>HelloGWT</h1>
     
    		<p>
    			This is an example of a host page for the HelloGWT application. 
    			You can attach a Web Toolkit module to any HTML page you like, 
    			making it easy to add bits of AJAX functionality to existing pages 
    			without starting from scratch.
    		</p>
     
    		<table align=center>
    			<tr>
    				<td id="slot1"></td><td id="slot2"></td><td id="slot3"></td>
    			</tr>
    		</table>
    	</body>
    </html>
    Lili.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
    43
    44
    45
    46
    47
    48
    49
    package com.mafanta.test.client;
     
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.event.dom.client.ClickEvent;
    import com.google.gwt.event.dom.client.ClickHandler;
    import com.google.gwt.event.dom.client.KeyCodes;
    import com.google.gwt.event.dom.client.KeyUpEvent;
    import com.google.gwt.event.dom.client.KeyUpHandler;
    import com.google.gwt.user.client.rpc.AsyncCallback;
    import com.google.gwt.user.client.ui.Button;
    import com.google.gwt.user.client.ui.DialogBox;
    import com.google.gwt.user.client.ui.HTML;
    import com.google.gwt.user.client.ui.Label;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.client.ui.TextBox;
    import com.google.gwt.user.client.ui.VerticalPanel;
    import com.google.gwt.user.client.ui.Widget;
     
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class Lili implements EntryPoint {
    	  /**
               * This is the entry point method.
               */
    	  public void onModuleLoad() {
    	    final Button button = new Button("Click me");
    	    final Label label = new Label();
     
    	    button.addClickHandler(new ClickHandler() {
    	      public void onClick(ClickEvent event) {
    	        if (label.getText().equals(""))
    	          label.setText("Hello World!");
    	        else
    	          label.setText("");
    	      }
    	    });
     
    	    // Assume that the host HTML has elements defined whose
    	    // IDs are "slot1", "slot2".  In a real app, you probably would not want
    	    // to hard-code IDs.  Instead, you could, for example, search for all 
    	    // elements with a particular CSS class and replace them with widgets.
    	    //
    	    RootPanel.get("slot1").add(button);
    	    RootPanel.get("slot2").add(label);
    	    RootPanel.get("slot3").add(label);
    	  }
    }
    Lili.gwt.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    <?xml version="1.0" encoding="UTF-8"?>
    <module>
      <!-- Inherit the core Web Toolkit stuff.                        -->
      <inherits name='com.google.gwt.user.User'/>
     
     
      <!-- Specify the app entry point class.                         -->
      <entry-point class='com.mafanta.test.client.Lili'/>
     
     
    </module>
    Images attachées Images attachées  

Discussions similaires

  1. [WB18] [COMPOSANT] Problème affichage et exécution de boutons
    Par Simeonn dans le forum WebDev
    Réponses: 0
    Dernier message: 12/07/2013, 14h26
  2. Problème affichage avec composant SWT
    Par alouky88 dans le forum SWT/JFace
    Réponses: 1
    Dernier message: 05/06/2012, 11h42
  3. Problème affichage composant
    Par mamoun_ dans le forum Flex
    Réponses: 3
    Dernier message: 01/11/2009, 18h14
  4. Problème d'affichage Composants
    Par setto dans le forum Débuter
    Réponses: 11
    Dernier message: 10/04/2009, 20h45

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