Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#254 closed enhancement (fixed)

make AttributeReader and AttributeStore work with a feature

Reported by: elemoine Owned by:
Priority: major Milestone: 1.0
Component: GeoExt.data.AttributeStore Version: trunk
Keywords: Cc:
State: Commit

Description

This ticket suggests extending the AttributeReader and AttributeStore so they can work with a feature.

When configured with a feature the AttributeReader will add a field named "value" to its record type, and it will create records with a "value" data field referencing the corresponding attribute value in the feature.

When configured with a feature the AttributeStore will update the feature attributes when the store is updated.

This functionality would be useful when, for example, creating a grid for editing feature attributes.

Attachments (3)

patch-254-A0.diff (14.5 KB) - added by elemoine 8 years ago.
patch-254-A1.diff (16.5 KB) - added by pgiraud 8 years ago.
patch-254-A2.diff (1.8 KB) - added by pgiraud 8 years ago.

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by elemoine

comment:1 Changed 8 years ago by elemoine

  • Component changed from GeoExt to GeoExt.data.AttributeStore

patch-254-A0.diff depends on patch attached to #253. Tests pass in FF3, IE8, and Chromium5.

comment:2 Changed 8 years ago by elemoine

  • State changed from None to Review

comment:3 Changed 8 years ago by pgiraud

In Eric's patch, the priority is given to the data when a value is set for an attribute record. This means that even if the feature has a value for this attribute, it will be overriden by the one in the attribute record. I think that the feature's value should be kept in this case. However, setting a value property in an attribute record can be used as a "default value" in case where the feature doesn't already have this attribute, or where it doesn't already have a value for this attribute.

The "patch-254-A1.diff" patch takes this into account.

Changed 8 years ago by pgiraud

comment:4 Changed 8 years ago by pgiraud

Tests pass in FF3.6, IE8, and Chromium5.

comment:5 Changed 8 years ago by elemoine

  • State changed from Review to Commit

Thanks for your review, and the extra tests. Please commit.

comment:6 Changed 8 years ago by pgiraud

  • Resolution set to fixed
  • Status changed from new to closed

(In [2130]) make AttributeReader and AttributeStore work with a feature, patches from elemoine and me, r=elemoine,me (Closes #254)

comment:7 Changed 8 years ago by pgiraud

  • State changed from Commit to Review

Actually, the work wasn't complete. In the case where the store constructor was given a feature *and* a data config parameters, the feature wasn't updated. The attached patch fixes this and provides a new unit test. Please review.

Changed 8 years ago by pgiraud

comment:8 Changed 8 years ago by elemoine

  • State changed from Review to Commit

Looks good Pierre, thanks.

comment:9 Changed 8 years ago by pgiraud

(In [2148]) Revert "make AttributeReader and AttributeStore work with a feature, patches from elemoine and me, r=elemoine,me (Closes #254)"

This reverts commit e4895415910f56464528fa7f642f7443fde64c59.

comment:10 Changed 8 years ago by pgiraud

(In [2149]) Revert "Revert "make AttributeReader and AttributeStore work with a feature, patches from elemoine and me, r=elemoine,me (Closes #254)""

This reverts commit 0702178ab69a9b7ed24d64f960b44aaced788322.

comment:11 Changed 8 years ago by pgiraud

(In [2150]) Revert "make AttributeReader and AttributeStore work with a feature, patches from elemoine and me, r=elemoine,me (Closes #254)"

This reverts commit e4895415910f56464528fa7f642f7443fde64c59.

comment:12 Changed 8 years ago by pgiraud

(In [2152]) make sure that feature is up to date when AttributeStore initialized with both data and feature, r=elemoine, (Closes #254, at least). I'm so sorry for the noise

Note: See TracTickets for help on using tickets.