<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Bob,<br>
    <br>
    &nbsp; Thanks for the info.&nbsp; I did a little experimenting and found out
    that "a Service with a user input type pointing to a user extension
    with a setValue function" will indeed work.<br>
    <br>
    So now I have a URL of <br>
    &nbsp;&nbsp;&nbsp; <tt>geomoose.html?call=set_combobox&amp;option_id=1</tt><br>
    <br>
    and a service of:<br>
    <tt>&nbsp;&nbsp;&nbsp; &lt;service name="set_combobox"&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type="ga_set_combobox" name="option_id"
      value="0"/&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/service&gt;</tt><br>
    <br>
    with a user extension function of:<br>
    <tt>&nbsp;&nbsp;&nbsp; GeoMOOSE.Services.InputType.SetComboBox =
      OpenLayers.Class(GeoMOOSE.Services.InputType, {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MAPBOOK_NAME: "ga_set_combobox",<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; setValue: function(option_id) {<br>
      &nbsp;&nbsp;&nbsp; // ---- &nbsp;&nbsp; &nbsp; TBD: Code to set combo box selection &nbsp;&nbsp; -----<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; });</tt><br>
    <br>
    The Chrome debugger says option_id = 1 so I think I'm good to go...<br>
    <br>
    I'm basking in the awesomeness of GeoMoose!<br>
    <pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
    <br>
    On 4/17/2012 3:56 PM, Bob Basques wrote:
    <blockquote cite="mid:4F8DA0D0020000A80003556F@heckle" type="cite">
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Comic
          Sans MS" size="3">Brent,</font> </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Comic
          Sans MS" size="3">It's not GeoMoose specific, but I did
          something similar with this function I found via Google:</font>
      </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function gup( name )</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name =
          name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var regexS =
          "[\\?&amp;]"+name+"=([^&amp;#]*)";</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var regex = new RegExp( regexS );</font>
      </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var results = regex.exec(
          window.location.href );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if( results == null )</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "";</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return results[1];</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</font> </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set center from request params</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pminx = gup( 'minx' );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pminy = gup( 'miny' );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pmaxx = gup( 'maxx' );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pmaxy = gup( 'maxy' );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var time_idx1=gup ( 'time_idx1' );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time_idx1 = time_idx1.replace(/%20/g, " ");</font>
      </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var time_idx2=gup ( 'time_idx2' );</font> </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time_idx2 = time_idx2.replace(/%20/g, " ");</font>
      </p>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Courier"
          size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var veh_id=gup ( 'veh_id' );</font> </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Comic
          Sans MS" size="3">It works very similarly to PERL param
          parsing. &nbsp;As you can see above, I have it set up to pass 7
          different values that are optionally used to start up a page,
          like so: </font><font color="#0000ff" face="Comic Sans MS"
          size="3"><a moz-do-not-send="true"
href="http://pwultra5.ci.stpaul.mn.us/cp_tiles/OpenLayers/OL.AVL.report2.html?veh_id=2042&amp;time_idx1=4/12/2012%206:00:00&amp;time_idx2=4/13/2012%206:00:00"><i><u>http://pwultra5.ci.stpaul.mn.us/cp_tiles/OpenLayers/OL.AVL.report2.html?veh_id=2042&amp;time_idx1=4/12/2012%206:00:00&amp;time_idx2=4/13/2012%206:00:00</u></i></a></font>
      </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Comic
          Sans MS" size="3">This may get you closer to your goal.</font>
      </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <font face="Comic
          Sans MS" size="3">bobb</font> </p>
      <br>
      <p style="margin-top: 0; margin-bottom: 0"> <br>
        <br>
        &gt;&gt;&gt; Brent Fraser <a class="moz-txt-link-rfc2396E" href="mailto:bfraser@geoanalytic.com">&lt;bfraser@geoanalytic.com&gt;</a> wrote:<br>
      </p>
      <table style="font-size: 1em; margin-bottom: 0; margin-top: 0;
        margin-right: 0; margin-left: 15px" bgcolor="#f3f3f3" border="0">
        <tbody>
          <tr>
            <td>
              <div style="padding-left: 7px; border-left: solid 1px
                #050505">
                <p style="margin-top: 0; margin-bottom: 0"> Looks like I
                  have a need to set an initial condition for my
                  GeoMoose v2.4 site based on URL request values (these
                  URLs are presented in a Django-generated page from a
                  database query).&nbsp;<br>
                  <br>
                  There already are a couple of ways to set initial
                  values in GeoMoose:<br>
                  <br>
                  1. Specifying a Startup Service (<a
                    moz-do-not-send="true"
                    href="http://www.geomoose.org/howto/startup.html">http://www.geomoose.org/howto/startup.html</a>)<br>
                </p>
                <pre style="border-left-width: 1px; padding-bottom: 0; border-bottom-width: 1px; font-size: 14px; text-indent: 0px; font-family: Consolas, Deja Vu Sans Mono, Bitstream Vera Sans Mono, monospace; letter-spacing: normal; padding-right: 0; text-transform: none; background-color: rgb(248, 248, 248); text-align: left; border-right-width: 1px; border-top-width: 1px; font-weight: normal; padding-top: 0; padding-left: 0; font-style: normal; color: rgb(0, 0, 0); word-spacing: 0px; font-variant: normal; line-height: 17px"><p style="letter-spacing: normal; font-size: 14px; padding-right: 0; border-left-width: 1px; font-variant: normal; border-top-width: 1px; word-spacing: 0px; padding-bottom: 0; font-weight: normal; border-right-width: 1px; text-indent: 0px; font-family: Consolas, Deja Vu Sans Mono, Bitstream Vera Sans Mono, monospace; text-transform: none; margin-bottom: 0; color: rgb(0, 0, 0); text-align: left; padding-top: 0; line-height: 17px; padding-left: 0; font-style: n
ormal; margin-top: 0; border-bottom-width: 1px; white-space: pre; background-color: rgb(248, 248, 248)">
geomoose.html?call=set_image&amp;fid</p>
          <p style="margin-top: 0; margin-bottom: 0; white-space: pre">
&nbsp;=10&amp;;image_id=20</p>
</pre>
                <p style="margin-top: 0; margin-bottom: 0"> 2. Bookmarks
                  (hey, where's the Bookmark doc?)<br>
                </p>
                <pre style="border-left-width: 1px; padding-bottom: 0; border-bottom-width: 1px; font-size: 14px; text-indent: 0px; font-family: Consolas, Deja Vu Sans Mono, Bitstream Vera Sans Mono, monospace; letter-spacing: normal; padding-right: 0; text-transform: none; background-color: rgb(248, 248, 248); text-align: left; border-right-width: 1px; border-top-width: 1px; font-weight: normal; padding-top: 0; padding-left: 0; font-style: normal; color: rgb(0, 0, 0); word-spacing: 0px; font-variant: normal; line-height: 17px"><p style="letter-spacing: normal; font-size: 14px; padding-right: 0; border-left-width: 1px; font-variant: normal; border-top-width: 1px; word-spacing: 0px; padding-bottom: 0; font-weight: normal; border-right-width: 1px; text-indent: 0px; font-family: Consolas, Deja Vu Sans Mono, Bitstream Vera Sans Mono, monospace; text-transform: none; margin-bottom: 0; color: rgb(0, 0, 0); text-align: left; padding-top: 0; line-height: 17px; padding-left: 0; font-style: n
ormal; margin-top: 0; border-bottom-width: 1px; white-space: pre; background-color: rgb(248, 248, 248)">
geomoose.html?extent=-2530013,127825</p>
      <p style="margin-top: 0; margin-bottom: 0; white-space: pre">
&nbsp;88,-202</p>
    <p style="margin-top: 0; margin-bottom: 0; white-space: pre">
8586,13213082&amp;on=Icebergs/all</p>
</pre>
                <p style="margin-top: 0; margin-bottom: 0"> <br>
                  But instead of the above scenarios, I want to call a
                  JavaScript function (in my user extension) to
                  programmatically select an item in the ZoomTo combo
                  box, something like:<br>
                </p>
                <pre style="border-left-width: 1px; padding-bottom: 0; border-bottom-width: 1px; font-size: 14px; text-indent: 0px; font-family: Consolas, Deja Vu Sans Mono, Bitstream Vera Sans Mono, monospace; letter-spacing: normal; padding-right: 0; text-transform: none; background-color: rgb(248, 248, 248); text-align: left; border-right-width: 1px; border-top-width: 1px; font-weight: normal; padding-top: 0; padding-left: 0; font-style: normal; color: rgb(0, 0, 0); word-spacing: 0px; font-variant: normal; line-height: 17px"><p style="letter-spacing: normal; font-size: 14px; padding-right: 0; border-left-width: 1px; font-variant: normal; border-top-width: 1px; word-spacing: 0px; padding-bottom: 0; font-weight: normal; border-right-width: 1px; text-indent: 0px; font-family: Consolas, Deja Vu Sans Mono, Bitstream Vera Sans Mono, monospace; text-transform: none; margin-bottom: 0; color: rgb(0, 0, 0); text-align: left; padding-top: 0; line-height: 17px; padding-left: 0; font-style: n
ormal; margin-top: 0; border-bottom-width: 1px; white-space: pre; background-color: rgb(248, 248, 248)">
geomoose.html?UX_call=set_combobox&amp;a mp;imag</p>
<p style="margin-top: 0; margin-bottom: 0; white-space: pre">
e_id=20</p>
</pre>
                <p style="margin-top: 0; margin-bottom: 0">
                  Note that I keep the id in the value tag of the combo
                  box options:<br>
                  <span style="COLOR:&quot;rgb(136, 18, 128)&quot;
                    ;FONT-FAMILY:&quot;monospace&quot;
                    ;FONT-SIZE:&quot;medium&quot;"><span
                      style="font-size: medium; text-indent: 0px;
                      white-space: pre-wrap; font-family: monospace;
                      letter-spacing: normal; text-transform: none;
                      text-align: -webkit-auto; font-weight: normal;
                      display: inline !important; font-style: normal;
                      float: none; color: rgb(136, 18, 128);
                      word-spacing: 0px; font-variant: normal;
                      line-height: normal">&lt;option </span></span><span
                    style="FONT-FAMILY:&quot;monospace&quot;
                    ;FONT-SIZE:&quot;medium&quot;"><span
                      style="font-size: medium; text-indent: 0px;
                      white-space: pre-wrap; font-family: monospace;
                      letter-spacing: normal; text-transform: none;
                      text-align: -webkit-auto; font-weight: normal;
                      font-style: normal; word-spacing: 0px;
                      font-variant: normal; line-height: normal"
                      class="webkit-html-attribute-name">value</span></span><span
                    style="COLOR:&quot;rgb(136, 18, 128)&quot;
                    ;FONT-FAMILY:&quot;monospace&quot;
                    ;FONT-SIZE:&quot;medium&quot;"><span
                      style="font-size: medium; text-indent: 0px;
                      white-space: pre-wrap; font-family: monospace;
                      letter-spacing: normal; text-transform: none;
                      text-align: -webkit-auto; font-weight: normal;
                      display: inline !important; font-style: normal;
                      float: none; color: rgb(136, 18, 128);
                      word-spacing: 0px; font-variant: normal;
                      line-height: normal">="</span></span><span
                    style="FONT-FAMILY:&quot;monospace&quot;
                    ;FONT-SIZE:&quot;medium&quot;"><span
                      style="font-size: medium; text-indent: 0px;
                      white-space: pre-wrap; font-family: monospace;
                      letter-spacing: normal; text-transform: none;
                      text-align: -webkit-auto; font-weight: normal;
                      font-style: normal; word-spacing: 0px;
                      font-variant: normal; line-height: normal"
                      class="webkit-html-attribute-value">10</span></span><span
                    style="COLOR:&quot;rgb(136, 18, 128)&quot;
                    ;FONT-FAMILY:&quot;monospace&quot;
                    ;FONT-SIZE:&quot;medium&quot;"><span
                      style="font-size: medium; text-indent: 0px;
                      white-space: pre-wrap; font-family: monospace;
                      letter-spacing: normal; text-transform: none;
                      text-align: -webkit-auto; font-weight: normal;
                      display: inline !important; font-style: normal;
                      float: none; color: rgb(136, 18, 128);
                      word-spacing: 0px; font-variant: normal;
                      line-height: normal">"&gt;</span></span><br>
                  <br>
                  I'm thinking of adding some code to the end of
                  "onLoadedMapbook" to mimic the GeoMOOSE.startService
                  call:<br>
                  <br>
                  <tt>&nbsp;&nbsp;&nbsp; var args = OpenLayers.Util.getParameters();<br>
                    &nbsp;&nbsp;&nbsp; if(args.call) {<br>
                    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GeoMOOSE.startService(args.call, args,
                    true);<br>
                    &nbsp;&nbsp;&nbsp; }</tt><br>
                  <br>
                  something like:<br>
                  <tt>&nbsp;&nbsp;&nbsp; var args = OpenLayers.Util.getParameters();<br>
                    &nbsp;&nbsp;&nbsp; if(args.UX_call) {<br>
                    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eval(args.UX_call+'('+args+')');<br>
                    &nbsp;&nbsp;&nbsp; }</tt><br>
                  <br>
                  But perhaps a Service with a user input type pointing
                  to a user extension with a "setValue" function would
                  work with a startupService...<br>
                  <br>
                  Maybe I'm making this too difficult.&nbsp; Any advice?<br>
                  <br>
                </p>
                <pre class="moz-signature" cols="72"><p cols="72" style="margin-bottom: 0; margin-top: 0; white-space: pre" class="moz-signature">
-- </p>
<p style="margin-top: 0; margin-bottom: 0; white-space: pre">
Best Regards,</p>
<p style="margin-top: 0; margin-bottom: 0; white-space: pre">
Brent Fraser</p>
</pre>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </blockquote>
  </body>
</html>