Hello,
I just getting started on web app builder and I have a question about embed application.
Is it possible to manage/control web app from parent element when It's embed into another page.
For example I have a page "test.html" which contains an Iframe. I would like to zoom to an extent or Add Data using button outside iframe.
I know I can use Url parameters to zoom in/out but is it possible to enhance Url parameters to manage new parameters (for exemple to add data or to communicate with a widget without reloading the page) ?
Maybe is there another way instead of an Iframe ?
If I'll modify "index.html" of my webapp to add buttons can I access to the map object ?
Best regards,
Sylvain.
Solved! Go to Solution.
Sylvain,
Yes you definitely can extend the Url Parameters in the app. The ConfigManager.js would be a great place for that. Also if the Url parameter has more to do with the map then there is the MapUrlParamsHandler.js file too.
It would be equally possible to make all your changes in the index.html. WAB global variables will be available there, like window._viewerMap which will be the apps map object.
Sylvain,
Yes you definitely can extend the Url Parameters in the app. The ConfigManager.js would be a great place for that. Also if the Url parameter has more to do with the map then there is the MapUrlParamsHandler.js file too.
It would be equally possible to make all your changes in the index.html. WAB global variables will be available there, like window._viewerMap which will be the apps map object.
thank you very much it's working !
One final question : where did you find the answer ?
I read Web app builder documentation and I did not find any document about global variables
I have been programming in WAB since it was released in beta. I spend time looking in the code and understanding how it works.
Hello Robert,
we need to write some custom functions in a .js file (using dojo library)
inside a downloaded web application embedded in an iframe.
How can we access to this function from a different iframe?
Thanks, Martina.
Martina,
Communication between iFrames is not really an esri GeoNet kind of question.
Normally you have a global var that references the opener. Something like this:
document.winobj = window.open("someurl", "_blank", features);
Then that html file has public functions or methods that you call using document.winobj
Then in the html file I opened, it can get access back to the widget using something like this:
window.opener.document.myWidget.setLatLonHandler(pt.lat(), pt.lng());
The document.myWidget was set inside the widgets postCreate method:
document.myWidget = this;
Hello,
Is it possible to embed web appbuilder for developer's edition in a web site? I have seen documentation on how to embed web app builder hosted on ArcGIS Online but noting about the developer's edition.
Thanks,
Simon.
I was able to embed web app builder app created from the developer's edition into a web site. I initially had issues with the app not being able to load due to mixed http content since I was using a proxy to login to ArcGIS Online. Once I was able to correct the mixed http content issue, it worked as expected.
Simon, how did you resolve the mixed content issue?
I made the correction on the config.json file by replacing http with https on the proxyUrl e.g. "proxyUrl": "https://Your domain name//DotNet/proxy.ashx"
I hope it helps.