<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi all,<br><br>I've been scratching my head over this and I'm wondering if this is possible. I want to replace the protocol of the GeoExt.form.FormPanel in the following way:<br><br>1. to render the formpanel, I defined a variable "proto" as null outside the formpanel (var proto = null).<br>2. then "proto" goes inside the formpanel (protocol: proto).<br>3. in the handler function of the button a new variable "proto" is defined. I want to replace this new variable inside the formpanel.<br><br>Since extjs, geoext, openlayers are javascript 
libraries, I've tried things such as "eval" to make the variable "proto" inside the handler accessible
 in the formpanel but 
no luck so far. Here it is a simplified example to show this:<br><br><pre style="" class="ecxdefault ecxprettyprint ecxprettyprinted"><code><span class="ecxkwd">var</span><span class="ecxpln"> proto </span><span class="ecxpun">=</span><span class="ecxpln"> </span><span class="ecxkwd">null</span><span class="ecxpun">;</span><span class="ecxpln">

</span><span class="ecxkwd">var</span><span class="ecxpln"> formPanel </span><span class="ecxpun">=</span><span class="ecxpln"> </span><span class="ecxkwd">new</span><span class="ecxpln"> </span><span class="ecxtyp">GeoExt</span><span class="ecxpun">.</span><span class="ecxpln">form</span><span class="ecxpun">.</span><span class="ecxtyp">FormPanel</span><span class="ecxpun">({</span><span class="ecxpln">
    protocol</span><span class="ecxpun">:</span><span class="ecxpln"> proto</span><span class="ecxpun">,</span><span class="ecxpln">    </span><span class="ecxcom">            # <--- replace with [1]</span><span class="ecxpln">
    items</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxpun">[{</span><span class="ecxpln">
        xtype</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxstr">"combo"</span><span class="ecxpun">,</span><span class="ecxpln">
        id</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxstr">"idcombo"</span><span class="ecxpun">,</span><span class="ecxpln">
        etc</span><span class="ecxpun">...</span><span class="ecxpln">
    </span><span class="ecxpun">},</span><span class="ecxpln"> </span><span class="ecxpun">{</span><span class="ecxpln">
        xtype</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxstr">"textfield"</span><span class="ecxpun">,</span><span class="ecxpln">
        id</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxstr">"idtext"</span><span class="ecxpun">,</span><span class="ecxpln">
        etc</span><span class="ecxpun">...</span><span class="ecxpln">
    </span><span class="ecxpun">}],</span><span class="ecxpln">
    button</span><span class="ecxpun">:[{</span><span class="ecxpln">
        text</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxstr">"search"</span><span class="ecxpun">,</span><span class="ecxpln">
        handler</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxkwd">function</span><span class="ecxpun">()</span><span class="ecxpln"> </span><span class="ecxpun">{</span><span class="ecxpln">
            formPanel</span><span class="ecxpun">.</span><span class="ecxpln">search</span><span class="ecxpun">();</span><span class="ecxpln">
            </span><span class="ecxkwd">var</span><span class="ecxpln"> combo </span><span class="ecxpun">=</span><span class="ecxpln"> </span><span class="ecxtyp">Ext</span><span class="ecxpun">.</span><span class="ecxpln">getCmp</span><span class="ecxpun">(</span><span class="ecxstr">'idcombo'</span><span class="ecxpun">).</span><span class="ecxpln">getValue</span><span class="ecxpun">();      # <--- this works and gets the value chosen </span><span class="ecxpln">in "xtype: combo"
</span></code><code><span class="ecxpln">           </span><span class="ecxkwd"> var</span><span class="ecxpln"> proto</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxkwd">new</span><span class="ecxpln"> </span><span class="ecxtyp">OpenLayers</span><span class="ecxpun">.</span><span class="ecxtyp">Protocol</span><span class="ecxpun">.</span><span class="ecxpln">HTTP</span><span class="ecxpun">({</span><span class="ecxpln">          </span><span class="ecxcom"># <--- [1] (ie. new variable "proto")</span><span class="ecxpln">
                url</span><span class="ecxpun">:</span><span class="ecxpln"> </span><span class="ecxstr">"http://www.pub.pub/"</span><span class="ecxpln"> </span><span class="ecxpun">+</span><span class="ecxpln"> combo </span><span class="ecxpun">+</span><span class="ecxpln"> </span><span class="ecxstr">"/somestuff/"</span><span class="ecxpln"></span><span class="ecxpln">,    # <--- this works<br>                format: etc...<br>        </span><span class="ecxpun">    })</span><span class="ecxpln">
        </span><span class="ecxpun">}</span><span class="ecxpln">
    </span><span class="ecxpun">}]</span><span class="ecxpln">
</span><span class="ecxpun">})</span></code></pre>how could I do this? I'll appreciate your support, thanks in advance.<br><br>Best regards,<br><br>Gery<br>                                        </div></body>
</html>