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 :

Gmap icefaces se rechargeant


Sujet :

JSF Java

Vue hybride

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

    Informations forums :
    Inscription : Juin 2007
    Messages : 104
    Par défaut Gmap icefaces se rechargeant
    Bonjour j'utilise le google map de icefaces ,et à chaque fois que j'appuis sur un bouton de ma page le map se rafraichi et ralenti à chaque fois mes processus.
    Comment je peux faire pour que cela ne se produise pas.
    voila un bout de code du map:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    <ice:gMap  id="gmap" address="#{gmap.address}"  locateAddress="#{gmap.locateAddress}">
     	 <ice:gMapControl id="largectrl" name="GLargeMapControl" rendered="#{gmap.showControls}"/>
                <ice:gMapControl id="scalectrl" name="GScaleControl" rendered="#{gmap.showControls}"/>
                <ice:gMapControl id="typectrl" name="GMapTypeControl" rendered="#{gmap.showControls}"/>
                <ice:gMapMarker id="gmarker" rendered="#{gmap.showMarkers}">
                    <ice:gMapLatLng id="glatlng" latitude="51.067591" longitude="-114.084862"/>
                    <ice:gMapLatLngs id="gmappnt" value="#{gmap.points}"/>
                </ice:gMapMarker> 
     
     </ice:gMap>
    Merçi

  2. #2
    Membre éclairé
    Inscrit en
    Juillet 2007
    Messages
    456
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 456
    Par défaut
    tu peux me montrer ton bean, pour la jspx rien d'anormales à mon avis !

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    104
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 104
    Par défaut
    voila 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
    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
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
     
    package controlArticle;
    import java.rmi.RemoteException;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Map;
    import java.io.Serializable;
     
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    import javax.faces.event.ValueChangeEvent;
     
    import org.json.JSONException;
    import org.json.JSONObject;
     
    import server.Server;
    import server.ServerProxy;
     
    import com.icesoft.faces.component.ext.RowSelectorEvent;
    import com.icesoft.faces.component.gmap.GMapLatLng;
     
    import controlArticle.inventories.InventoryItem;
     
    /**
     * <p>The GmapBean is responsible for setting up default map markers,
     * as well as the selecting of cities, searching for addresses, and toggling
     * the visibility of the map ui controls.</p>
     *
     * @dolfendo1.7
     */
    public class GmapBean  implements Serializable {
        /**
             * 
             */
    	//lattitude and longitude
     
    	private String longitude;
    	private String latitude;
    	// address to search for
    	private String geoCoderAddress = "";
        // city location selected from a preset list
    	private String standardAddress = "";
        // whether we should search for an address or not
    	private boolean locateAddress = false;
    	private List points = new ArrayList();
    	private boolean showControls = true;
    	private boolean showMarkers = true;
        // value bound to the gmap component
    	private String address = "Saint cloud";
    	private String idselect="";
     
    	public GmapBean() {
            // Generate a set of default map marker locations
    		points.add(new GMapLatLng("37.379434", "-121.92293"));
    		points.add(new GMapLatLng("33.845449", "-84.368682"));
    		points.add(new GMapLatLng("34.05333", "-118.24499"));
    		points.add(new GMapLatLng("33.072694", "-97.06234"));
            points.add(new GMapLatLng("37.391278", "-121.952451"));
    	}
     
    	public String getStandardAddress() {
    		return standardAddress;
    	}
     
    	public void setStandardAddress(String standardAddress) {	
    		this.standardAddress = standardAddress;
    		this.address = standardAddress;
    	}
     
    	public List getPoints() {
    		return points;
    	}
     
    	public void setPoints(List points) {
    		this.points = points;
    	}
     
        public String getGeoCoderAddress() {
            return geoCoderAddress;
        }
     
    	public void setGeoCoderAddress(String geoCoderAddress) {
    		this.geoCoderAddress = geoCoderAddress;
    	}
     
        public boolean isShowControls() {
            return showControls;
        }
     
        public void setShowControls(boolean showControls) {
            this.showControls = showControls;
        }
     
        public boolean isShowMarkers() {
            return showMarkers;
        }
     
        public void setShowMarkers(boolean showMarkers) {
            this.showMarkers = showMarkers;
        }
     
        public String getAddress() {
            return address;
        }
     
        public void setAddress(String address) {
            this.address = address;
        }
     
     
    	public void boutonPressed(ActionEvent event) {
     
     
    		Server s = new ServerProxy();
    		String json="";
    		try {
    			json=	s.getAddress(idselect);
    			JSONObject jison= new JSONObject(json);
        		json=jison.getString("address");
        		jison=new JSONObject(json);
        		this.address=jison.getString("city");
    			this.latitude=jison.getString("lat");
    			this.longitude=jison.getString("lng");
    		} catch (RemoteException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} catch (JSONException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
     
     
    	      this.setLocateAddress(true);
    		}
     
     
    	public boolean isLocateAddress() {
    		if (locateAddress) {
    			locateAddress = false;
    			return true;
    		}
    		return false;
    	}
     
    	public void findAddress(ValueChangeEvent event) {
    		locateAddress = true;
    	}
     
     
    	 public void rowSelectionListener(RowSelectorEvent event) 
    	 	{
     
    		 this.setIdselect("");
    	       int i= event.getRow();
    	      InventoryItem valeur1=(InventoryItem) DragDropController.shoppingCart.getInventory().get(i);
    	        this.idselect=""+valeur1.getPictureName();
     
     
     
     
    	 	}
     
    	public String getLongitude() {
    		return longitude;
    	}
     
    	public void setLongitude(String longitude) {
    		this.longitude = longitude;
    	}
     
    	public String getLatitude() {
    		return latitude;
    	}
     
    	public void setLatitude(String latitude) {
    		this.latitude = latitude;
    	}
     
    	public void setLocateAddress(boolean locateAddress) {
    		this.locateAddress = locateAddress;
    	}
     
    	public String getIdselect() {
    		return idselect;
    	}
     
    	public void setIdselect(String idselect) {
    		this.idselect = idselect;
    	}
    }
    la méthodes boutonpressed est appelé quand je clic sur localisation:
    Voila la où j'utilise mon jspx:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <ice:commandButton id="localiser"  styleClass="myborDer" actionListener="#{gmap.boutonPressed}" value="#{bundle.localisation_boutton_label}"/>

  4. #4
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    104
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 104
    Par défaut
    Autre chose mais je pense que cela provient toujours du google map.Sur firefox j'ai cette erreur sur la console:
    initialize(undefined)icefaces-d2d.js (line 20)
    iceSubmitPartial(form#_id39.iceFrm iceSubmit('_id39..., input#_id39:_id40:0:gmaplat 48.843901, Object)icefaces-d2d.js (line 25)
    initialize("_id39:_id40:0:gmap", Object W=Object f=div#_id39:_id40:0:gmap.gmap Oa=[3], "geocoder", undefined)ice-extras.js (line 26)
    initialize((48.843901, 2.219447) wp=48.843901 Gb=2.219447 x=2.219447 y=48.843901)ice-extras.js (line 26)
    so(Object name=Saint cloud Status=Object Placemark=[1])main.js (line 1456)
    oo(Object name=Saint cloud Status=Object Placemark=[1])main.js (line 1436)
    jk(Object name=Saint cloud Status=Object Placemark=[1])
    c'est chaud car le javaScript généré est incompréhensible.

Discussions similaires

  1. [Google Maps] Rechargement dynamique gmap
    Par toto158 dans le forum APIs Google
    Réponses: 2
    Dernier message: 07/09/2014, 17h16
  2. [JSP][servlet]rechargement de la page
    Par deldin dans le forum Servlets/JSP
    Réponses: 4
    Dernier message: 09/06/2004, 12h14
  3. [VB.NET] Provoquer le rechargement d'un user control..
    Par didoboy dans le forum ASP.NET
    Réponses: 7
    Dernier message: 30/04/2004, 14h17
  4. ACTIVE X Controle recharger
    Par philippe V dans le forum MFC
    Réponses: 4
    Dernier message: 16/01/2004, 21h02
  5. [web] rechargement de page html
    Par GMI3 dans le forum Web
    Réponses: 2
    Dernier message: 22/09/2003, 09h49

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