Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#96 closed enhancement (fixed)

LayerNode and Legend don't update when layer changes name

Reported by: bartvde Owned by:
Priority: major Milestone: 0.5
Component: GeoExt.LegendPanel Version: SVN
Keywords: Cc:
State: Commit

Description

Currently the LayerNode text and the LegendPanel title don't update when the layer's name changes value. OpenLayers does send the changelayer event with property name, and the LayerStore sends out an update event. But the LayerNode and LegendPanel don't update their values.

This is for instance a use case in our catalogue application, when adding the layer we do not know the title, we only know if after parsing the GetCapabilities, so the title comes in late and we want to update it.

Attachments (4)

ticket96.patch (10.1 KB) - added by bartvde 8 years ago.
patch containing tests
ticket96.2.patch (5.9 KB) - added by bartvde 8 years ago.
patch containing tests
ticket96.3.patch (7.6 KB) - added by bartvde 8 years ago.
new patch implementing Andreas' comments
geoext-96.patch (8.4 KB) - added by ahocevar 8 years ago.
fixed tests in IE, some coding style improvements

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by bartvde

patch containing tests

Changed 8 years ago by bartvde

patch containing tests

comment:1 Changed 8 years ago by bartvde

  • State changed from None to Review

comment:2 Changed 8 years ago by ahocevar

  • Milestone changed from 0.6 to 0.5
  • State changed from Review to Needs more work

Bart: since layer nodes can also live without a container, layer nodes have to listen for the changelayer event (instead of the container). Let me know if you have time to make this change, otherwise I will try to do it. Either way, I would like to have this in 0.5.

Changed 8 years ago by bartvde

new patch implementing Andreas' comments

comment:3 Changed 8 years ago by bartvde

  • State changed from Needs more work to Review

Hi Andreas, I've changed the patch. Btw one of the layernodes tests was failing for me before this change so I've also patched that one in my patch (the change is in the destroy function of LayerNode).

Btw, still having issues with whitespace formatting when using svn diff, not sure why.

Changed 8 years ago by ahocevar

fixed tests in IE, some coding style improvements

comment:4 Changed 8 years ago by ahocevar

  • State changed from Review to Commit

Bart: I only made a few changes: tests in IE failed because due to the map panel not being rendered yet, the layerstore cannot be guessed. Fixed that, and while at it also checked for proper layerStore before destroying (instead it was not guessed yet). Also made some minor coding style improvements (especially items.get(n) instead of items.items[n]).

Tests now pass in FF3 and IE7. Please commit.

comment:5 Changed 8 years ago by bartvde

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

(In [1115]) make sure legend and layer nodes update when layer name is changed r=ahovecar (closes #96)

comment:6 Changed 8 years ago by ahocevar

(In [1118]) Now that we have assigned layerStore, use it instead of this.layerStore. Non-functional change (see #96)

Note: See TracTickets for help on using tickets.