title: GeoExt.LayerOpacitySlider not working on WMS layers, any idea why?
body: <p>I have a website using OpenLayers and the GeoExt library.
  My goal is to have an opacity slider for each of my layers (I have 5 layers). Right now, it's working with my vector layer, but not my WMS layers. I tried with the base layer (open street map) and it's working fine.</p>
  
  <p>This is the code that creates the layer:</p>
  
  <pre><code>//This part is inside an "if success" in an ajax request.   
  map.addLayer(new OpenLayers.Layer.WMS(openlayers_wms_layer_analyses, CMCDataServer, {
  layers: analysesWMSLayer[currentStatePeriod],
  styles: analysesWMSStyle[currentStatePeriod],
  format: "image/png",
  transparent: true,
  time: currentStateDate.getUTCFullYear() + "-" + ('0' + (currentStateDate.getUTCMonth() + 1)).slice(-2) + "-" + ('0' + currentStateDate.getUTCDate()).slice(-2) + "T" + timeChopArray[currentStateIndex] + ":00:00Z"
       },
  {
       opacity: 0.73,
       visibility: true
   }));
  Ext.getCmp('analyses_validity_display_extjs').setValue(extjs_gui_state_panel_valid_analyses);
  Ext.getCmp('extjs_gui_legend_tab_panels').setActiveTab(0);
  } else {
      Ext.getCmp('analyses_validity_display_extjs').setValue(extjs_gui_state_panel_invalid_analyses);
      Ext.Msg.alert(extjs_gui_analyses_missing_warning_title, extjs_gui_analyses_missing_warning);
      Ext.getCmp('analyses_checkbox_extjs').setValue(false);
      }
  }
  });
  
  //This part is a little lower in my code, it's an "else" after the ajax request on top. 
  }else if(map.getLayersByName(openlayers_wms_layer_analyses).length!=0){
      adjustStatePanelAnalysesValidity();
      map.removeLayer(map.getLayersByName(openlayers_wms_layer_analyses)[0]);
  }
      adjustStatePanelProducts(checkbox, checked);
  }
  </code></pre>
  
  <p>And this is my slider's code:</p>
  
  <pre><code>new GeoExt.LayerOpacitySlider({
         width: 100,
         value: 100,
         layer: map.getLayersByName(openlayers_wms_layer_analyses)[0],
         aggressive: true, 
         style: {
              position: 'absolute',
              left: '150px'
         }
   }), 
  </code></pre>
  
  <p>I'm using the same exact code for my vector layer's slider and it's working fine. And if I change the name of the layer to my base layer, it's also working fine. I can't think it's because I'm not selecting the right layer, as I use the name used in the layer creation. If you check the way the layer is removed, you'll see that it uses the same line as me, like this: <code>map.removeLayer(map.getLayersByName(openlayers_wms_layer_analyses)[0]);</code></p>
  
  <p>Would you have an idea to help me please?</p>
  
  <p>UPDATE: I wrote <code>map.getLayersByName(openlayers_wms_layer_analyses)[0]</code> in the javascript console. If I did not checked the box to see the layer, I get 'undefined', but if it's check and I can see the layer, I see the layer correctly. Which means my slider <em>should</em> work.. no?</p>