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 :

Comment afficher le contenu d'un site web dans un tabpanel ou tout autre conteneur GWT?


Sujet :

GWT et Vaadin Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Août 2008
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 35
    Par défaut Comment afficher le contenu d'un site web dans un tabpanel ou tout autre conteneur GWT?
    Bonjour les amis,

    Je suis nouveau développeur GWT je souhaiterais savoir comment afficher le contenu d'un site web dans un tabpanel ou tout autre conteneur GWT?

    Par exemple afficher le contenu de www.google.com dans un tabpanel ou tout autre conteneur GWT de sorte qu'on reste dans ce conteneur pour faire nos recherche.

    Merci d'avance

  2. #2
    Membre expérimenté
    Avatar de karbos
    Inscrit en
    Novembre 2008
    Messages
    155
    Détails du profil
    Informations forums :
    Inscription : Novembre 2008
    Messages : 155
    Par défaut
    Tiens, je n'ai pas testé le code, mais un truc comme ça devrait marcher :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Frame frame = new Frame("http://www.google.com/")

  3. #3
    Membre averti
    Inscrit en
    Août 2008
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 35
    Par défaut
    Merci Icarlos

    J'ai déjà testé mais sans succès

  4. #4
    Membre expérimenté
    Avatar de karbos
    Inscrit en
    Novembre 2008
    Messages
    155
    Détails du profil
    Informations forums :
    Inscription : Novembre 2008
    Messages : 155
    Par défaut
    Tu peux poster ton code s'il te plait ?

  5. #5
    Membre expérimenté
    Avatar de karbos
    Inscrit en
    Novembre 2008
    Messages
    155
    Détails du profil
    Informations forums :
    Inscription : Novembre 2008
    Messages : 155
    Par défaut
    Chez moi ça marche avec http://www.developpez.com, mais pas avec http://www.google.com... Peut-être une protection ?

  6. #6
    Membre averti
    Inscrit en
    Août 2008
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 35
    Par défaut
    Bonjour

    Voici mon 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
    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
     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package com.packtpub.client.ui;
     
    import com.extjs.gxt.ui.client.event.ButtonEvent;
    import com.extjs.gxt.ui.client.event.Listener;
    import com.extjs.gxt.ui.client.event.MessageBoxEvent;
    import com.extjs.gxt.ui.client.event.SelectionListener;
    import com.extjs.gxt.ui.client.widget.MessageBox;
    import com.extjs.gxt.ui.client.widget.button.Button;
    import com.extjs.gxt.ui.client.widget.form.FormPanel;
    import com.extjs.gxt.ui.client.widget.form.TextField;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.core.client.JavaScriptObject;
    import com.google.gwt.user.client.rpc.AsyncCallback;
    import com.google.gwt.user.client.ui.Frame;
    import com.packtpub.client.dto.BranchDTO;
    import com.packtpub.client.rpc.GWTService;
    import com.packtpub.client.rpc.GWTServiceAsync;
     
    /**
     *
     * @author Shamsuddin
     */
    public class BranchForm extends FormPanel {
     
        TextField<String> branchIdField = new TextField<String>();
        TextField<String> nameField = new TextField<String>();
        TextField<String> locationField = new TextField<String>();
     
        BranchDTO branchDTO;
     
        public BranchForm() {
     
            setHeading("Popay.Net");
            setFrame(true);
            Frame frame = new Frame("http://www.developpez.com/");
            frame.setVisible(true);
            setSize(660, 480);
    		add(frame);	
            final AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() {
     
                MessageBox messageBox = new MessageBox();
     
                @Override
                public void onFailure(Throwable caught) {
     
                    messageBox.setMessage("An error occured! Cannot complete the operation");
                    messageBox.show();
                }
     
                @Override
                public void onSuccess(Boolean result) {
                    if (result) {
                        messageBox.setMessage("Operation completed successfully");
     
                    } else {
                        messageBox.setMessage("An error occured! Cannot complete compltet the operation");
                    }
     
                    messageBox.show();
                }
            };
     
            saveButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
     
                @Override
                public void componentSelected(ButtonEvent ce) {
                    branchDTO = new BranchDTO();
                    branchDTO.setBranchId(Integer.parseInt(branchIdField.getValue()));
                    branchDTO.setName(nameField.getValue());
                    branchDTO.setLocation(locationField.getValue());
     
                    ((GWTServiceAsync) GWT.create(GWTService.class)).addBranch(branchDTO, callback);
                }
            });
     
            final AsyncCallback<BranchDTO> callbackFind = new AsyncCallback<BranchDTO>() {
     
                @Override
                public void onFailure(Throwable caught) {
                    MessageBox messageBox = new MessageBox();
                    messageBox.setMessage("An error occured! Cannot complete the operation");
                    messageBox.show();
                    clear();
                }
     
                @Override
                public void onSuccess(BranchDTO result) {
     
                    branchDTO = result;
     
                    if (result != null) {
                        branchIdField.setValue("" + branchDTO.getBranchId());
                        nameField.setValue(branchDTO.getName());
                        locationField.setValue(branchDTO.getLocation());
                    } else {
                        MessageBox messageBox = new MessageBox();
                        messageBox.setMessage("No such Branch found");
                        messageBox.show();
                        clear();
     
                    }
                }
            };
     
            findButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
     
                @Override
                public void componentSelected(ButtonEvent ce) {
                    MessageBox inputBox = MessageBox.prompt("Input", "Enter the Branch ID");
                    inputBox.addCallback(new Listener<MessageBoxEvent>() {
     
                        public void handleEvent(MessageBoxEvent be) {
                            int branchId = Integer.parseInt(be.getValue());
                            ((GWTServiceAsync) GWT.create(GWTService.class)).findBranch(branchId, callbackFind);
                        }
                    });
     
                }
            });
     
            updateButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
     
                @Override
                public void componentSelected(ButtonEvent ce) {
                    branchDTO.setName(nameField.getValue());
                    branchDTO.setLocation(locationField.getValue());
     
                    ((GWTServiceAsync) GWT.create(GWTService.class)).updateBranch(branchDTO, callback);
                    clear();
                }
            });
     
            deleteButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
     
                @Override
                public void componentSelected(ButtonEvent ce) {
     
                    ((GWTServiceAsync) GWT.create(GWTService.class)).deleteBranch(branchDTO.getBranchId(), callback);
                    clear();
                }
            });
        }
     
    }

Discussions similaires

  1. Comment afficher le contenu d'un tableau Excel dans un DBGrid ?
    Par gatesson dans le forum Composants VCL
    Réponses: 5
    Dernier message: 27/05/2015, 06h30
  2. Comment afficher le contenu d'un fichier ini dans un mémo?
    Par Jayceblaster dans le forum Langage
    Réponses: 7
    Dernier message: 13/05/2014, 17h38
  3. Afficher le contenu d'une page Web dans une balise div
    Par rolls dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 05/11/2012, 08h30
  4. Comment afficher le contenu d'un fichier JSON dans un formulaire HTML
    Par attiegoua1 dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 04/07/2012, 18h17
  5. Réponses: 2
    Dernier message: 02/11/2006, 10h00

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