Google Groups

Re: [InterSystems-EnsHlth] Refresh iframe src in zen using menu controls


Dale du Preez Jan 13, 2012 6:04 AM
Posted in group: InterSystems: Ensemble in Healthcare
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

On 1/2/2012 9:34 AM, Antony A wrote:
> 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.
>