[Users] GeoExt.AttributeStore question
Eric Lemoine
eric.lemoine at camptocamp.com
Thu Oct 14 08:59:08 CEST 2010
On Wed, Oct 13, 2010 at 9:25 PM, Andrew Stewart
<Andrew.Stewart at reddeer.ca> wrote:
> I am trying to use a GeoExt.data.attribute store to populate the data field
> of an ext.form.combobox. I have tried to debug using firebird etc to see
> stuff inside neighbourhood_name_store below but it doesn't seem to be
> working properly. When I actually copy the request URL it performs the
> request correctly and I am trying to put the data field as the attribute
> from the request which is like-
>
> - <xs:complexType name="NeighbourhoodsType">
> - <xs:complexContent>
> - <xs:extension base="gmgml:NeighbourhoodsSubType">
> - <xs:sequence>
> <xs:element name="NEIGHBOURHOODID" type="xs:int" />
> <xs:element name="NEIGHBOURHOOD_NAME"
> type="gmgml:Neighbourhoods_NEIGHBOURHOOD_NAMEType" minOccurs="0" />
> <xs:element name="LABEL_LINE1" type="gmgml:Neighbourhoods_LABEL_LINE1Type"
> minOccurs="0" />
> <xs:element name="LABEL_LINE2" type="gmgml:Neighbourhoods_LABEL_LINE2Type"
> minOccurs="0" />
> <xs:element name="LABEL_LINE3" type="gmgml:Neighbourhoods_LABEL_LINE3Type"
> minOccurs="0" />
> <xs:element name="YearBuilt" type="gmgml:Neighbourhoods_YearBuiltType"
> minOccurs="0" />
> <xs:element name="Geometry"
> type="gmgml:Polygon_Surface_MultiSurface_CompositeSurfacePropertyType"
> minOccurs="0" />
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
>
> Not sure why but it doesn't seem to be working, appreciate any assistance.
Some comments below.
>
> var neighbourhood_name_store = new GeoExt.data.AttributeStore({
> url:
> "http://localhost/RedWFS/request.aspx?REQUEST=describeFeatureType&SERVICE=WFS&version=1.1.0&typename=Neighbourhoods"
> });
>
> neighbourhood_name_store.load();
In your case you need not load the store yourself, the combobox will
load it when needed.
>
> alert(neighbourhood_name_store.feature);
Your AttribureStore doesn't work with a feature, so you shouldn't
expect store.feature to be defined. Binding a feature to an
AttributeStore corresponds to a specific use of AttributeStore.
>
> //Type dropdown
> var neighbourhoodCombo = new Ext.form.ComboBox({
> fieldLabel: 'Neighbourhood Name',
> boxMaxWidth: 159,
> name: 'neighbourhood_Name',
> hiddenName: 'NEIGHBOURHOOD_NAME',
> forceSelection: true,
> store:neighbourhood_name_store,
> valueField: 'NEIGHBOURHOOD_NAME',
> emptyText: "NEIGHBOURHOOD_NAME",
> displayField: "NEIGHBOURHOOD_NAME",
> selectOnFocus: true
> });
You cannot set valueField, emptyText and displayField to
"NEIGHBOURHOOD_NAME". The AttributeStore stores attribute records,
whose fields are "name", "type", etc (edit AttributeStore.js and
AttributeReader.js for more information). I think you may want to set
these properties to "name" instead.
Hope it helps,
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list