If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Report closes when clicking on HTML button to center Google Map

Started by bberryhill, 23 May 2016 04:26:06 PM

Previous topic - Next topic

bberryhill

This problem occurs in the latest version of Chrome (Version 50.0.2661.102 m)
The production report is more complex but the simple code I have attached illustrates the problem.
When the attached html file is open in Chrome the map displays and the user can move the map around.
The "Center Map" button below the map works fine - calls a function that sets the map back to the center.

Take the same code, create a blank report studio report, add an html tag to the report and paste in the code.  Save the report.
Run the report in Chrome - the map displays, the user can move the map around but when the "Center Map" button is clicked, the report exits, and in my case, Cognos returns to the Home location - just as if I had clicked the Home button.  I see the "home" in the url of the browser.

Run the report in IE 11 and it works just fine.

The production version has additional buttons that call functions to put markers on the map.  In Chrome, I sometimes see the called function execute (displays markers) before the report exits.

I have used HTML items to display a link in the report that the user can click.
                                '<a href="#" onClick="displayJobSiteMarkers( )">Show Job Sites</a> '
When the link is clicked the function is called.  This approach works in both Chrome and IE.  But, the link button does not look as good and more importantly, I do not know how to change the label once it has been clicked.  Using the buttons in IE I am able to toggle the button -- 'Show Marker' / 'Hide Marker' and based on the button label execute the appropriate function.

Any help is greatly appreciated.

bberryhill

Stumbled across the solution in the comments section of this article on developer works:
https://www.ibm.com/developerworks/community/blogs/0a7c97bb-6cf9-4ddb-a918-80994e7b444d/entry/ibm_cognos_mashup_with_google_maps2?lang=en

Specifying type=button in the button definition solves the problem in Chrome.

<button id="PlantMarkers" type="button" onClick="toggleButton(this.id)">Show Plant Markers</button>