[Users] AttributeForm - how does it work
Alexandre Dube
adube at mapgears.com
Thu Feb 10 16:39:56 CET 2011
Eric,
Looking at the GeoExt components for the attributes management, I can
say that they were made to be binded per feature and not per layer.
Changing the feature on the fly would still require the store to be
reloaded, thus recreating the attribute records. From that point, I
don't really see the advantage of not recreating the required objects.
So I'll try the FeatureEditorGrid ux which basically already does
almost everything I need.
Thanks again for your comments,
Alexandre
On 11-02-10 09:06 AM, Alexandre Dube wrote:
> Hi Eric,
>
> Thanks for the explanation.
>
> I didn't remember about the FeatureEditorGrid ux. You're right, it
> could be a nice pick. It requires to be created on each feature select
> though, and to my eye that seems like a lot of unnecessary process.
> Since all features from a same layer have the same attributes, it seems
> unnecessary having to recreate the store / grid all the time. Some kind
> of manual feature binding could be done, and methods to load the current
> state of a feature's attribute to the form and vice-versa could be
> nice. I'm not sure where or how this could be implemented though...
>
> I'll look deeper and try to find out what could be the best solution
> for me to use / create.
>
> Thanks again,
>
> Alexandre
>
>
> On 11-02-10 01:33 AM, Eric Lemoine wrote:
>> On Wednesday, February 9, 2011, Alexandre Dube<adube at mapgears.com> wrote:
>>> If I may add :
>>>
>>> I create the form empty (without any "feature" property set). Is it
>>> possible to use one store per layer and bind the form a feature only
>>> when selected and unbind after it has been unselected or do I need so
>>> specify a unique store per feature everytime ?
>> Hi Alexandre,
>>
>> To work with per-layer attribute stores you'll need to be able to
>> rebind an attribute store to a new feature. AttributeStore doesn't
>> support that currently. So I think the easiest would be to create a
>> new form each time a feature is selected for modification. But still,
>> I think that, when creating the form, the fields values won't be
>> automatically set based on the values of the attribute records. And
>> when the user changes a value in the form the change won't
>> automatically propagate to the corresponding attribute record (and
>> feature). You'll have to do all this manually. Have you considered
>> using the FeatureEditorGrid extension? It will do all this sync work
>> for you, and it works pretty well.
>>
>
--
Alexandre Dubé
Mapgears
www.mapgears.com
More information about the Users
mailing list