[Users] popup to show feature information

Mario Nuñez Jimenez mario.nunez at atosresearch.eu
Mon Mar 8 17:03:52 CET 2010


I already fixed it using the item attribute of the popup.
Thank you anyway.
Cheers.












-----Original Message-----
From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of Mario Nuñez Jimenez
Sent: jueves, 04 de marzo de 2010 12:11
To: users at geoext.org
Subject: Re: [Users] popup to show feature information

Hello,
the las thing I tried:

function createForm(feature) {
pointformPanel = new GeoExt.form.FormPanel({
    renderTo: "popup",
    protocol: new OpenLayers.Protocol.WFS({
        url: "http://192.168.215.148:8080/geoserver/wfs",
        featureType: "evento_punto_Type",
        featureNS: "http://gea.atosorigin.es/gea"
    }),
    items: [{
        xtype: "numberfield",
        name: "incidente",
        value: feature.attributes['incidente']
    }, {
        xtype: "datefield",
        name: "fecha",
        value: feature.attributes['fecha']
    }, {
        xtype: "textfield",
        name: "descripcion",
        value: feature.attributes['descripcion']
    }],
    listeners: {
        actioncomplete: function(form, action) {
            // this listener triggers when the search request
            // is complete, the OpenLayers.Protocol.Response
            // resulting from the request is available
            // in "action.response"
        }
    }
});

};
/*
formPanel.addOkButton({
    text: "aceptar",
    handler: function() {
		this.submit();
        this.close();
    },
    scope: formPanel
});
formPanel.addCancelButton({
    text: "cancelar",
    handler: function() {
        this.close();
    },
    scope: formPanel
});
*/

function createPopup(feature,form) {
    popup = new GeoExt.Popup ({
    id: 'popup',
    title: 'Geometria',
    feature: feature,
    width: 200,
    html: form.render(),
    //items: [],
    //html: getInfo(), 
    //feature.attributes['descripcion'],
    //feature.attributes['incidente'],
	//feature.attributes['fecha'],
    /*
    items:[{
		xtype: 'columnchart',
		store: getStore(),
		yField: 'hits',
		xField: 'month',
		xAxis: new Ext.chart.CategoryAxis({
			title: 'Month'
		}),
		yAxis: new Ext.chart.NumericAxis({
			title: 'Hits'
		}),
		extraStyle: {
		   xAxis: {
				labelRotation: -90
			}
		}
	    }, {html: getInfo()}],
	    */
	layout: 'fit',   
	//html: feature.getInfo(),
    collapsible: true
    });
// unselect feature when the popup is closed
popup.on({
    close: function(layer) {
            selectControl.unselect(this.feature);
    }
});
popup.render
popup.show();

}

// create popup on "featureselected"
pointLayer.events.on({
    featureselected: function(e) {
            createPopup(e.feature,createForm(e.feature));
    }
});

// create popup on "featureselected"
lineLayer.events.on({
    featureselected: function(e) {
            createPopup(e.feature);
    }
});


When I tried this, the web loaded correctly but when I select a feature on the map, it gets selected and highlighted but nothing happens, no popup opened, and I get an error that I do not understand...

ct is null
http://localhost:8080/mugagabe-webclient/js/mapfish-client-1.2/mfbase/ext/ext-all-debug.js
Line 15002

I think it is because of the renderization, I readed that this error happens because the component you want to render doesn’t exist so I still haven’t found the reason...

Any tip?
Regards.
Mario.
------------------------------------------------------------------
This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive 
this e-mail in error, please notify the sender immediately and destroy it. 
As its integrity cannot be secured on the Internet, the Atos Origin 
group liability cannot be triggered for the message content. Although 
the sender endeavours to maintain a computer virus-free network, 
the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted. 

Este mensaje y los ficheros adjuntos pueden contener informacion confidencial 
destinada solamente a la(s) persona(s) mencionadas anteriormente 
pueden estar protegidos por secreto profesional. 
Si usted recibe este correo electronico por error, gracias por informar 
inmediatamente al remitente y destruir el mensaje. 
Al no estar asegurada la integridad de este mensaje sobre la red, Atos Origin 
no se hace responsable por su contenido. Su contenido no constituye ningun 
compromiso para el grupo Atos Origin, salvo ratificacion escrita por ambas partes. 
Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor 
no puede garantizar nada al respecto y no sera responsable de cualesquiera 
danos que puedan resultar de una transmision de virus. 
------------------------------------------------------------------
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
------------------------------------------------------------------
This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive 
this e-mail in error, please notify the sender immediately and destroy it. 
As its integrity cannot be secured on the Internet, the Atos Origin 
group liability cannot be triggered for the message content. Although 
the sender endeavours to maintain a computer virus-free network, 
the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted. 

Este mensaje y los ficheros adjuntos pueden contener informacion confidencial 
destinada solamente a la(s) persona(s) mencionadas anteriormente 
pueden estar protegidos por secreto profesional. 
Si usted recibe este correo electronico por error, gracias por informar 
inmediatamente al remitente y destruir el mensaje. 
Al no estar asegurada la integridad de este mensaje sobre la red, Atos Origin 
no se hace responsable por su contenido. Su contenido no constituye ningun 
compromiso para el grupo Atos Origin, salvo ratificacion escrita por ambas partes. 
Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor 
no puede garantizar nada al respecto y no sera responsable de cualesquiera 
danos que puedan resultar de una transmision de virus. 
------------------------------------------------------------------


More information about the Users mailing list