[Geomoose-users] Button in Geomoose

Dan Little danlittle at yahoo.com
Thu May 15 10:42:32 EDT 2008


Yes, you need to specify it, there are two options:

1) Configuration.js has an array called "CUSTOM_SCRIPTS" (IIRC) and you should be able to add an entry for maplegrove.js

2) Add the following into your "<head>...</head>" entry in index.html

<script type="text/javascript" src="maplegrove.js"></script>


----- Original Message ----
From: Jay Kapalczynski <jkapalczynski at ci.maple-grove.mn.us>
To: Dan Little <danlittle at yahoo.com>; geomoose-developers at lists.sourceforge.net; geomoose-users at lists.sourceforge.net
Sent: Thursday, May 15, 2008 9:36:42 AM
Subject: RE: [Geomoose-users] Button in Geomoose

 
I create the js file…pasted the
function in it.
 
I use something like this to
call a function
 
<p><input
type="button" value="Click here" onclick="showAlert();"></p>
 
Do I have to specify the maplegrove.js
file…cause the function is in another file?
 
Appreciate the help….a little
green with JavaScript…
 
Thanks Brian and Duck
 
From:Dan Little
[mailto:danlittle at yahoo.com] 
Sent: Thursday, May 15, 2008 9:27 AM
To: Jay Kapalczynski; geomoose-developers at lists.sourceforge.net;
geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] Button in Geomoose
 
Hey Jay,

I've ran into this before with different browsers, occasionally they don't take
well to the addition of "script" tags in the document after it's
loaded.

In the config file there is a "CUSTOM_SCRIPTS" array which lists
javascript files that will be loaded on startup.  (I think this is fully
working, it was being used at Saint Paul.)  

So I'd do something like this.

create a file called "maplegrove.js" which contains your function
(which I assume you later want to do more complex things).

maplegrove.js.
--------------------
function alertSomeStuff(msg) {
    alert('This is your message:' + msg);
}

The next thing I would make sure you do is when defining the button to make
sure you use one of two conventions.

<!--- browsers sometimes get picky about onClick versus onclick, so try to
use the lower-case only version -->
<button onclick="alertSomeStuff('[PARCEL_ID]')">My
Button</button>

or...

<!-- With inputs don't forget the ending "/>" -->
<input onclick="alertSomeStuff('[PARCEL_ID]')" value="My
button value"/>

-Duck
----- Original Message ----
From: Jay Kapalczynski <jkapalczynski at ci.maple-grove.mn.us>
To: geomoose-developers at lists.sourceforge.net;
geomoose-users at lists.sourceforge.net
Sent: Thursday, May 15, 2008 9:13:29 AM
Subject: [Geomoose-users] Button in Geomoose
I am trying this:
 
This is on my Identify_Parcels.html
 
The button shows up in the tab after you do the idntify but
nothing happens when I click the actual button
 
Any thoughts?
 
 
 
<tr>
<td colspan="2"><b>Parcels
Layer</b></td>
</tr>
<tr>
<td align="right">PID:</td>
<td>[PID]</td>
</tr>
<tr>
<td align="right">Address:</td>
<td>[ADDRESS]</td>
</tr>
<tr>
<td align="right">Assessing
Sketches:</td>
<td><a
href="pdf\Assessing_Sketches\[SKETCHES]"
target="_blank">[SKETCHES]</a></td>      
</tr>
 
 
<script language="javascript"
type="text/javascript">
function showAlert() {
 alert('This is an alert message!');
}
</script>
 
<p><input type="button" value="Click
here" onClick="showAlert();"></p>


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20080515/91e16ff5/attachment.html


More information about the Geomoose-users mailing list