<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">Hi all,<br><br>How can I overwrite the url of OpenLayers.Protocol.HTTP? I tried <br><br>> searchformPanel.protocol.url<br><br>and it works (checked with console.log), but at the end the original url is sent (in the code below: url: '/fs/') (see attached picture).<br><br>![output from firebug][1]<br><br>This is the code: <br><br> var searchformPanel = new GeoExt.form.FormPanel({<br> border: false,<br> width: 250,<br> protocol: new OpenLayers.Protocol.HTTP({<br> url: '/fs/',<br> format: new OpenLayers.Format.GeoJSON()<br> }),<br> items:[{<br> xtype: 'combo',<br> id: 'idcombo',<br> store: new Ext.data.SimpleStore({<br> fields:['fsclass','ollayer'],<br> data:[["Boreholes","Boreholes"],["All_layers","All layers"]]<br> }),<br> displayField: 'ollayer',<br> valueField: 'fsclass',<br> fieldLabel: 'Layer',<br> emptyText: 'select a layer',<br> submitValue: false,<br> selectOnFocus: true,<br> mode: 'local',<br> typeAhead: true,<br> editable: false,<br> forceSelection: true,<br> triggerAction: 'all'<br> },{<br> xtype: 'textfield',<br> id: 'idtextfield',<br> fieldLabel: 'Find features',<br> emptyText: 'enter word',<br> name: 'comments__like',<br> allowBlank: false<br> }],<br> listeners:{<br> actioncomplete: function(form, action){<br> searchShowTip(action.response.features);<br> }<br> },<br> buttons:[{<br> text: 'search',<br> listeners:{<br> click: function(){<br><br> var comboLayer = Ext.getCmp('idcombo').getRawValue();<br> var keyword = Ext.getCmp('idtextfield').getRawValue();<br><br> var newUrl = '/fs/' + comboLayer + '?format=GeoJSON&comments__ilike=' + keyword + '&queryable=comments';<br> console.log('1:' + newUrl);<br><br> //this gets '/fs/' from the searchformPanel<br> console.log('2:' + searchformPanel.protocol.url);<br><br> searchformPanel.protocol.url = newUrl;<br> console.log('3:' + searchformPanel.protocol.url);<br><br> searchformPanel.search();<br> }<br> }<br> }]<br> });<br><br>Please any support about this is very welcome, thank you!<br><br> [1]: http://i.stack.imgur.com/mY1pq.png<br id="FontBreak"></font><br><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br> </div></body>
</html>