<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Just a note for those trying to do the same thing.&nbsp; Bob was
    successful when he changed his function name to be all lowercase.<br>
    <pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
    <br>
    On 5/24/2011 8:34 AM, Brent Fraser wrote:
    <blockquote cite="mid:4DDBC1EB.5020509@geoanalytic.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <title></title>
      Bob,<br>
      <br>
      &nbsp; Have a look at <a moz-do-not-send="true"
        class="moz-txt-link-freetext"
        href="http://www.geomoose.org/docs/user_extensions.html">http://www.geomoose.org/docs/user_extensions.html</a>
      and varoius pages on the wiki (<a moz-do-not-send="true"
        class="moz-txt-link-freetext"
        href="http://www.geomoose.org/wiki/index.php/Main_Page">http://www.geomoose.org/wiki/index.php/Main_Page</a>),
      and the functions defined in the geomoose.js file.&nbsp; The functions
      in the file are the user-accessible "official" GeoMOOSE API.&nbsp;
      These resources may give you a few ideas.<br>
      <br>
      In one of my sites,&nbsp; I needed to get the value of the selected
      item in a combo box and use it for input value in services.<br>
      <br>
      My combo box is a little complicated; the important bits are
      id="GA_SelectedImage" and the first part of the option value
      (1,2,3,etc)<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;div id="control-panel"&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;center&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Image:<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;select id="GA_SelectedImage"
onchange="GeoMOOSE.UX.registered_extensions.GA_ImageOps.prototype.zoomToImage(this.value);"&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;option value=""&gt;Choose Image:&lt;/option&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;option
      value="1:-2172034,13348962,-1027313,14456993:Landsat/p230r005_20010703"&gt;L7


      2001-07-03 p230-r005&lt;/option&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;option
      value="2:-2564614,12851203,-1468813,13863841:Landsat/p230r006_20010703"&gt;L7


      2001-07-03 p230-r006&lt;/option&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;option
      value="3:-2564614,12851203,-1468813,13863841:Landsat/p231r006_20010608"&gt;L7


      2001-06-08 p231-r006&lt;/option&gt;<br>
      <br>
      <br>
      I have a service called "add_polygon" (see the Feature Editor doc)
      where one of the inputs is defined as "imageid":<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;service name="add_polygon"&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type="ga_get_imageid" name="feature:imageid"
      value="0"/&gt;<br>
      <br>
      <br>
      Note the type tag value refers to my custom input type.&nbsp; And [I
      think?] since its outside the the "&lt;step&gt;" tag it is not
      shown to the user.&nbsp; If I wanted to make it visible and changeable
      by the user I could have done:<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;service name="add_polygon"&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;step type="input"&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="ga_get_imageid" name="feature:imageid"
      value="0"/&gt;<br>
      <br>
      <br>
      I defined the type by creating a Javascript file in the extensions
      folder containing:<br>
      <br>
      GeoMOOSE.Services.InputType.GetImageID =
      OpenLayers.Class(GeoMOOSE.Services.InputType, {<br>
      &nbsp;&nbsp;&nbsp; MAPBOOK_NAME: "ga_get_imageid",<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp; getValue: function() {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var selection =
      document.getElementById('GA_SelectedImage');<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var theValue =
      selection.children[selection.selectedIndex].value;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var aParams = theValue.split(':');<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var id = aParams[0];<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return id;<br>
      &nbsp;&nbsp;&nbsp; }<br>
      });<br>
      <br>
      And my JavaScript file is loaded in my main html page:<br>
      &lt;script type="text/javascript"
      src="extensions/GeoAnalytic_Custom.js"&gt;&lt;/script&gt;&nbsp;&nbsp;&nbsp; <br>
      <br>
      So basically, when the service is invoked, it processes the input
      types, and calls the ga_get_imageid function.&nbsp; The function finds
      the combo box control, gets the selected value, and returns the
      important part of the value.&nbsp; GeoMoose sets the service's input
      type value to that returned value and passes it to the target URL
      of the service.<br>
      <br>
      Somewhat complicated, but it separates my custom JavaScript from
      the standard GeoMOOSE (making updates much easier).<br>
      <pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
      <br>
      On 5/23/2011 12:11 PM, Bistrais, Bob wrote:
      <blockquote
cite="mid:4EFF8BB964547748A07CA32961810C041B47CE9A@SOM-TEAQASMAIL1.som.w2k.state.me.us"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <meta name="Generator" content="Microsoft Word 11 (filtered
          medium)">
        <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
        <div class="Section1">
          <p class="MsoNormal"><font face="Arial" size="2"><span
                style="font-size: 10pt; font-family: Arial;">Hi,<o:p></o:p></span></font></p>
          <p class="MsoNormal"><font face="Arial" size="2"><span
                style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
          <p class="MsoNormal"><font face="Arial" size="2"><span
                style="font-size: 10pt; font-family: Arial;">I&#8217;m looking
                to dynamically control some of the parameter values in
                mapbook.xml.&nbsp; In a nutshell, I&#8217;ve been able to save a
                selected town name by holding it in a hidden input in
                index.html.&nbsp; So what I&#8217;d like to do, in the
                search_parcels service, is to update a parameter with
                that town name.&nbsp; I believe it would make use of some
                javascript, but I&#8217;m not quite sure how to do it.&nbsp; Any
                suggestions?&nbsp; Any more clarification needed?<o:p></o:p></span></font></p>
        </div>
        <br>
      </blockquote>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/quest-d2dcopy1">http://p.sf.net/sfu/quest-d2dcopy1</a></pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Geomoose-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Geomoose-users@lists.sourceforge.net">Geomoose-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/geomoose-users">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a>
</pre>
    </blockquote>
  </body>
</html>