<div dir="ltr">Thank you. With this solution if i click three times the buton with different paramter's value i will have in the layer's url three <br><blockquote class="gmail_quote">viewparams: "province:" + idProv or just the final one ?<br>
</blockquote><div><br>thank you very much.<br></div><br><div class="gmail_quote">2011/5/15 Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
instead of layer.redraw(true), try<br>
<br>
layer.mergeNewParams({viewparams: "province:" + idProv});<br>
<br>
Regards,<br>
Andreas.<br>
<div><div></div><div class="h5"><br>
On Sun, May 15, 2011 at 11:20 AM, hassane allouch<br>
<<a href="mailto:allouch.hassane@gmail.com">allouch.hassane@gmail.com</a>> wrote:<br>
> Hello<br>
><br>
> I have a mappanel (containning a wms layer with parametrized url {sql View})<br>
> , a textField and buton. When the user enter the value of the parameter's<br>
> url and click the buton, the mapPanel should reload with the new url (the<br>
> new value of the parameter) without reloading all the web page. I tried<br>
> layer.redraw(true), it refreshs the panel but wth the same value of the<br>
> parameter (so the same url).<br>
><br>
><br>
> this is the code:<br>
><br>
> var layerDashBoard = new OpenLayers.Layer.WMS(<br>
> "communeProv",<br>
><br>
> "<a href="http://localhost:8080/geoserver/sf/wms?service=WMS&version=1.1.0&request=GetMap&layers=sf:communeProv&srs=EPSG:4326&viewparams=province" target="_blank">http://localhost:8080/geoserver/sf/wms?service=WMS&version=1.1.0&request=GetMap&layers=sf:communeProv&srs=EPSG:4326&viewparams=province</a>:"<br>
> + idProv,<br>
> {layers: "sf:communeProv",<br>
> format: "image/png",<br>
> }<br>
><br>
> );<br>
><br>
> thank you<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
</font></blockquote></div><br></div>