Returning Values from HTML5 Viewer to parent website
Hi,
Current Scenario : HTML5 viewer is embedded in a website (which is primarily accessed via mobile devices)
Requirement : Once the use has selected an address of interest, it has to be passed back to the parent webpage for further processing.
Can anyone let me know the best way to pass values from a HTML5 Viewer to the parent webpage?
Regards,
Gops
-
Subscribed as well. I'd like to know if this is possible. It has been a big limitation for us with Silverlight.
If it's easier in HTML5, I'd imagine a migration would occur :-)
0 -
Please substitute "frames" for "regions" in my last sentence.
0 -
Hi Jason,
Thanks for the detailed response. I will try this approach and let you know how it goes.
Regards,
Gops
0 -
Hi Jason,
I've finally managed to pass values back to the container webpage using the concept you've explained. Many thanks for that.
Can you also tell me if there is a way to trigger/publish/emit an event from within the workflow?
Regards,
Gops
0 -
Is there a way to send a particular attribute (or a set of attributes) of an identified/selected feature to the parent website?
0 -
Hi Erik,
As Jason explained, the "SomeNewCustomCommand" should be invoked in the workflow via the "RunExternalCommand" activity.
At this point, you can pass a variable/s as parameter/s to the "RunExternalCommand" activity.
Just store the feature attribute/s in these variables and you'll have them in the parent website in the "args" of "SomeNewCustomCommand" function.
Cheers,
Gops
0 -
Thanks Gops,
I have the added task of sending the args to the website, that is not on the same domain as the viewer.
Not quite sure how I can do this. I can alert the args into the viewer, but somehow I need to send the message to the website so that the message can be used in an element by its ID.
Thanks for everyone's help so far and your patience with a java n00b.
0 -
Has anyone done this successfully for sending commands from a child window to the parent window being the html5 application? Similar to an html bridge with silverlight?
0 -
Hi,
i went through this problem, and i use the proposed solution here, it's working OK when the viewer and its parent application on the same Domain, but when the two web applications in different Domain the didn't work, i try some solutions according to web search but the didn't work as well. I noticed that when i used two HTML test applications in different Domains, they worked fine. but when I use GeoCortex HTML viewer as a child it didn't work, so i wonder if there's any security level in the HTML viewer may prevent the parent request from different Domain, appreciate your fast response, thanks
0 -
Hi,
Could you please attach the sample source code for this. It would be more helpful.
Thanks,
Rajhpandian N
0 -
When the code is on a different domain, I think you're going to have to setup a (http://javascript.info/tutorial/cross-window-messaging-with-postmessage) window.postMessage interface . Setup a listener in the viewer and on the page, and then you can pass messages and handle accordingly.
0 -
any examples of calling a workflow with arguments and passing the arguements from a child window to the html5 parent window ?
0 -
i was curious bout the "same domain" does that mean that both html files should be stored on the same server, where geocortex lives? so if a client runs the parent html from thier desktop, are they actually in a different domain, even though both html files are on the same server? also i am in the agency domain, but i cannot seem to pass arguments to geocortex in my iframe. does that indicate a domain problem? 0 -
Is anyone can help me to find out the right command to connect with a child window? In our case, the viewer isn't embedded in a website. In the viewer, user hit a button which opens a html page (host on the same domain and on the same server). This html page is an adress search which need to communicate with the viewer (pan/zoom to, display points, etc). (already deployed in Silverlight)
So I do have a opener,
this command _html5 = window.opener; is a object but how do I connect it then to the viewer? There is no object related with window.opener.viewer;
Here is how I set the viewer.
var viewerConfig = {"viewerConfigUri": null};
var viewer = new geocortex.essentialsHtmlViewer.ViewerApplication(viewerConfig.viewerConfigUri, null, <myViewerID>);
What am I missing?
I assume I don't have to load the viewer into the html page (which is unlogical) Am I right?0 -
Hi Jordan,
I would have like to test communicating with the viewer via "window.opener" even then because all development already exist in the Silverlight viewer.
Plus, Ive been working for one month with 3rdPartyMaps and googleMaps.html trying to debug some strange behaviors so I'm not really exicted to use "PostMessage" facility right now.
If I do so, I assume I would have to reference Bridge.js to acces to those commands ans events like that?:
<script src="../Html5Viewer/Resources/ScriptsBridge.js"></script>
and then,
if I want to center the map to the point, I use:
this.bridge.publish("BroadcastCurrentViewpoint", this.id);
and so on,
?0 -
Hi Philippe,
Yes, you will want to reference the "Bridge" script. This enables commands and events to travel between frames (provided their arguments are serializable via "JSON.stringify").
There is also a "ThirdPartyMap.js" script that will handle a bunch of plumbing, albeit for map-centric tasks. I think the Bing Maps example might be a good place to start from or at least to use as reference.
Using the Bridge, you can call "bridge.publish" to publish commands AND events, and conversely, you can use "bridge.on" to receive commands and events. This includes built in viewer commands, as well as custom ones.
For example, you can configure an I Want To... menu item that calls a command implemented in your custom script, or you can implement a custom command in the viewer and call that from your custom script.
Hope this helps!0
Please sign in to leave a comment.
Comments
16 comments