[mapserver-users] so i have newbie question

Daniel Morissette morissette at dmsolutions.ca
Sun Feb 3 16:34:42 EST 2002


Grant Marblestone wrote:
> 
> So i have been working along with some other people on this site
> http://66.1.116.66:8080/aweb/gmap_permits/htdocs/index.html
> 
> and i want to know if its possible to have the gmapdumpqueryresults()
> 
> on a separate frame from the actual map?  I am doing this so that the
> above map page will not reload and only the query results will change
> on the bottom frame.
> 

Yes it is possible to redirect output to a separate frame or even to
another window by setting the FORM's TARGET.  To do this you'll have to
write some JavaScript functions to be called 'onClick' for each of the
controls in the page that can submit the form, even those buttons that
are not targetted to a separate frame.  There is nothing specific to
MapServer here... it's just making use of JavaScript to control the
action and target of a FORM.

Now, in your case I see that you use the ROSA applet... so things are
different because there is no way to set an onClick callback on an
applet.  But ROSA has a parameter called "TB_BUT_*_JSACTION" which does
the same as an onClick would do on a submit button.

I attached below 2 JavaScript functions that can be used as JSACTIONs in
ROSA to achieve what you want.

You have to set TB_BUT_*_JSACTION to have an empty TARGET value and
point to the main gmap_permits.php script for all your ROSA toolbar
buttons...

<PARAM NAME="TB_BUT_zoomin_JSACTION" 
       VALUE="submitAction('','gmap_permits.php')"> 

... except the QUERY button for which you would set the target to
'query_frame' and have it call a separate point_query.php script to
handle the query on the server...

<PARAM NAME="TB_BUT_query_JSACTION"
       VALUE="submitAction('query_frame','point_query.php')"> 


I hope that helps.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.



function submitAction(strTarget, strAction)
{
    // Force new form action and target and submit

    if ((mapForm = document.forms[0]) == null)
    {
        window.alert("Map form not found!");
        return;
    }

    mapForm.target = strTarget;
    mapForm.action = strAction;
    mapForm.submit();
}




More information about the mapserver-users mailing list