Refresh iframe src in zen using menu controls

2 views
Skip to first unread message

Antony A

unread,
Jan 2, 2012, 9:34:10 AM1/2/12
to InterSystems: Ensemble in Healthcare
Hi

I have created a zen application and i have used <iframe> in the zen
page. Within that <iframe> i am calling a deepSee dashboard. and also
i have few menus and submenus.

When i click the the menu or submenu the dashboard url should be
changed within the <iframe src>.

Eg:

i am using <iframe> like

<i frame src="http://localhost/csp/
_DeepSee.UserPortal.DashboardViewer.zen?DASHBOARD=patient.dashboard"
width="1000" height="750"/>

When i click "physician" menu, the frame should be automatically
navigated to the the next dashboard link "http://localhost/csp/
_DeepSee.UserPortal.DashboardViewer.zen?
DASHBOARD=physician.dashboard".

Kinldy suggest me the solution.

Dale du Preez

unread,
Jan 13, 2012, 9:04:17 AM1/13/12
to ensemble-in...@googlegroups.com
Hi Antony,

For future reference, it may be better to use the Zen community at
http://groups.google.com/group/intersystems-zen for more help. (I am not
sure if you already posted your question there, but it's a much better
resource for Zen-specific questions.)

Nonetheless, I can still provide you with some help. In your XData
block, define your iframe as follows:
<i frame id="dashboardFrame"
src="http://localhost/csp/_DeepSee.UserPortal.DashboardViewer.zen?DASHBOARD=patient.dashboard"

width="1000" height="750"/>

(Note that you can use any id -- dashboardFrame is fairly descriptive
for this case.)

Then create a function something like the following:
ClientMethod changeDashboard(newDashboard) [ Language = javascript ]
{
var dashFrame = zen('dashboardFrame'); // here the zen() function
is a shortcut for zenPage.getComponentById()
var dashURL = '_DeepSee.UserPortal.DashboardViewer.zen?DASHBOARD='
+ newDashboard;
dashFrame.setProperty('src',dashURL);
}

In your onclick handling for your menu or button, you can then make the
onclick something like:
onclick="zenPage.changeDashboard('physician.dashboard');"

I hope that helps,
Dale

Reply all
Reply to author
Forward
0 new messages