Select to view content in your preferred language

disable attribute table update when zoom in/out

2103
9
02-26-2014 06:31 PM
LefterisKoumis
Frequent Contributor
The attribute table is a tough nut to crack.

I created a duplicated attribute table, so when I perform a query it will show only the results of the query.

However, when you zoom in/out, the attribute table is updated to include any visible features that are not part of the query.

So, my goal is to develop a way to disable the updating process when you zoom in/out and have this duplicate table post only query results.

The attributetable has a property called updateEnabled but it didn't work. I think the process that updates the table must be buried in the API.

So,  I am in the process to create an alternate process that is not very practical.

In the init of the attribute table, I set a boonlean variable that is by default to false. If it is false, then it should exit the init and terminate further process.

The query process that it is originated from another widget sends a the boonlean variable (widget communication - Thanks Robert) to the attribute table as true and it opens the attribute table with the query results.

If you zoom in/out that boonlean variable will be false it will not alter the table.

So, here are my two questions.

Is there an easier way to disable the updating the table when you zoom in out?

If not, how can you exit the widget in runtime? If in the init of the attribute table the boonlean is false, how can it exit the widget.When I use vb.net it was easy to do so, but how it's done in flex?

Thank you.
Tags (2)
0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   This might have some unforeseen consequences but try this
The yourFeatureLayer is the id of your feature layers

yourFeatureLayer.removeEventListeners(LayerEvent.UPDATE_END);
                yourFeatureLayer.removeEventListeners(LayerEvent.UPDATE_START);
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   This might have some unforeseen consequences but try this
The yourFeatureLayer is the id of your feature layers

yourFeatureLayer.removeEventListeners(LayerEvent.UPDATE_END);
                yourFeatureLayer.removeEventListeners(LayerEvent.UPDATE_START);


Thank you Robert. This function takes two arguments, but anyway I tried it and it doesn't prevent the attribute table from refreshing. Do you know where in the api when you zoom in/out, it updates the attribute table entries?

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   Strange in my test application it did exactly what you asked for, prevented the zoom or pan from updating the table.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   Strange in my test application it did exactly what you asked for, prevented the zoom or pan from updating the table.


Perhaps, I inserted at the wrong location. Where did you inserted them?

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   I will have to check on this, as I now am thinking that the reason I have a removeEventListeners is because of some custom work I was doing.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,
  
   I have to take back my suggestion as when I did my test app it was not using the AttributeTable widget, but just a Flex API app that was using an AttributeTable component, and I did have a Monkey Patch applied that gives me the removeEventListeners (which normally would not be there). I have now tried to duplicate my success in the test API app, but this time using viewer and the widget, and I have been unsuccessful. Oh, well I thought I had an easier route for you, but I didn't.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,
  
   I have to take back my suggestion as when I did my test app it was not using the AttributeTable widget, but just a Flex API app that was using an AttributeTable component, and I did have a Monkey Patch applied that gives me the removeEventListeners (which normally would not be there). I have now tried to duplicate my success in the test API app, but this time using viewer and the widget, and I have been unsuccessful. Oh, well I thought I had an easier route for you, but I didn't.


Thank you for checking it out for me.

Do you know what the triggers the attribute table refresh when you zoom in out (changing the extent of the map)? I was unable to find that and it would be a big help for me to take it from there...

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   That is the problem... The LayerEvent.UPDATE_START and  LayerEvent.UPDATE_END that are attached to the feature layer, are added by the AttributeTable Flex API component, and thus they are not exposed to you as a developer. The LayerEvent.UPDATE_START and  LayerEvent.UPDATE_END both call CommitProperties function inside the component. The only reason I know this is by using a customized version of FlexSpy to see the eventListeners that are added by the AttributeTable component. The only possibility I can think of is to extend the AttributeTable component and override the CommitProperties function, but I don't know what all the function is doing.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   That is the problem... The LayerEvent.UPDATE_START and  LayerEvent.UPDATE_END that are attached to the feature layer, are added by the AttributeTable Flex API component, and thus they are not exposed to you as a developer. The LayerEvent.UPDATE_START and  LayerEvent.UPDATE_END both call CommitProperties function inside the component. The only reason I know this is by using a customized version of FlexSpy to see the eventListeners that are added by the AttributeTable component. The only possibility I can think of is to extend the AttributeTable component and override the CommitProperties function, but I don't know what all the function is doing.


You are correct. After it first opens, any refresh is through the api. I am hesitant to spend time and effort to override the CommitProperties function since I don't know the implications I do so. Bummer.
0 Kudos