Olá Tozé, Desculpa só responder agora mas estive de férias sem acesso ao mail. Sim já consegui solucionar vendo o exemplo do mapfish editing panel: http://demo.mapfish.org/mapfishsample/trunk/examples/editing/editing-panel.html Vê o código deste widget em: http://www.mapfish.org/trac/mapfish/browser/trunk/MapFish/client/mfbase/mapfish/widgets/editing/FeatureEditingPanel.js e procura o método "updateFeatureAttributes" Penso que a diferença está na utilização da propriedade "data" da classe "OpenLayers.Feature" (não documentada...) Tenta adaptar o código à tua aplicação e se tiveres problemas diz qualquer coisa! Abraço, Gabriel
--- Em sáb, 25/7/09, Toze (Antonio Jose Silva) <[email protected]> escreveu: > De: Toze (Antonio Jose Silva) <[email protected]> > Assunto: Re: [Portugal] wfs update > Para: "Gabriel Nolasco" <[email protected]> > Data: Sábado, 25 de Julho de 2009, 15:39 > Boa tarde Gabriel, > > Desculpa estar-te a incomodar, mas estou com um problema > semelhante ao > teu. Já o conseguiste solucionar? > > Um abraço, > > Toze > > Gabriel Nolasco wrote: > > Hi! > > > > I’m trying to update feature’s attributes on a WFS > layer without successes. > > > > This is my layer instantiation: > > > > var myWFSLayer = new OpenLayers.Layer.WFS( > > "myWFSLayerName", > > "myWFSLayerServiceURL", > > {typename: > 'topp:myWFSLayerTypename'}, > > { > > typename: > "myWFSLayerTypename", > > featureNS: "http://www.openplans.org/topp", > > > extractAttributes: true > > } > > ); > > > > > > My feature attributes: > > > > var myAttributes = { > > "myField1": "myAttribute1", > > "myField2": > "myAttribute2" > > } > > > > > > If I commit a new feature setting the state to > “insert” the transaction succeeds and the feature is > stored with its attributes: > > > > myNewFeature.state = OpenLayers.State.INSERT; > > myNewFeature.attributes = myAttributes; > > myWFSLayer.commit(); > > > > > > However, if I set a previously existent feature state > to "update" there are no changes in the database after the > commit and the feature keeps its old attributes: > > > > myOldFeature.state = OpenLayers.State.UPDATE; > > myOldFeature.attributes = myAttributes; > > myWFSLayer.commit(); > > > > > > I’m using postgreSQL 8.3 + GeoServer 1.7.5 + > OpenLayers 2.8 > > Anyone has an idea about what I’m missing? > > > > Thanks in advance, > > Gabriel Nolasco > > > > > > > ____________________________________________________________________________________ > > Veja quais são os assuntos do momento no Yahoo! > +Buscados > > http://br.maisbuscados.yahoo.com > > _______________________________________________ > > Portugal mailing list > > [email protected] > > http://lists.osgeo.org/mailman/listinfo/portugal > > > > > > ____________________________________________________________________________________ Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com _______________________________________________ Portugal mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/portugal
