Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUI update from DNN ServiceUI update from DNN Service
Previous
 
Next
New Post
4/9/2015 5:04 AM
 

Hi guys need a bit of advice.

I have somewhat of convoluted process in place where I have a stand alone application (different domain) that posts stuff back to DNN via Web API into DNN service which I created.

On basic level I wired up a DNN module to triggers for a new browser window to open.

Browser window serves as a proxy to access stand alone application I mentioned.

While user does what s(he) needs to do the App communicates with DNN.

Problem I am having is that communication between DNN and stand alone app happens through a back door in DNN if you like. This means no automatic access to PortalSettings and all the good stuff it carries. But I managed to tag on a few things to be sent back namely UserID, ModuleID, TabID.

Is it possible for my DNN service to trigger UI update of the module that triggered browser window to open say on successful completion of request processing from the App?

PS: Unfortunately I cannot iframe the App in question as its configured with X-Frame-Options header.

 
New Post
4/13/2015 5:40 AM
 

OK, I nailed the solution for this rather convoluted problem.

In case someone else faces the same issue in the future I have used a combination of javascript Window.postMessage() and .Net ClientScriptManager.RegisterClientScriptBlock(Type, String, String, Boolean) to achieve DNN UI update.

Logic behind:

My remote app was modified with RegisterClientScriptBlock() to register execution of window.opener.postMessage() after DNN had communicated successful processing of the earlier message indicating that DNN UI needs to update. window.opener is the key here.

Inside my DNN module all I added was logic required to update UI itself inside of receiveMessage(event) function and relevant event listener.

Should you fear post messages from untrustworthy sources be sure to use

if (event.origin !== "http://example.org")
    return;

 

And thats all it took in the end.

 

PS: At first I tried to use javascript window.onunload event to trigger postMessage() but that had the effect of updating UI much too soon, in fact as soon as I triggered the POST request not giving adequate time to actually process the request. Otherwise the UI was updating just fine when I closed the window or triggered a subsequent request.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUI update from DNN ServiceUI update from DNN Service


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out