0

Page redirection from another page

asked 2010-11-08 04:40:38 +0800

pektop gravatar image pektop
6

Hello,

I have two zul pages. Page 1 contains two frames. Page 2 is a frame (left.zul) and I need to change <iframe src/> of second frame(center). But the problem is that I cannot call other frame properties from left.zul page. Tried with Desktop and pages, but "mainPage" is not visible inside left.zul, get "org.zkoss.zk.ui.ComponentNotFoundException: Page not found: mainPage" exception. I need main.zul center frame redirection on onClick event from left.zul file. How to make main.zul properties visible inside left.zul file?

main.zul

<?page id="mainPage" title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" id="mainWindow">
<borderlayout height="500px">
<center id="main_center" border="normal">
    The Center
   </center>
<west size="15%" splittable="true" id ="main_west" collapsible="true">
    <iframe  src="/main/frames/left.zul"/>
</west>
</borderlayout>
</window>
</zk>

left.zul

<?page id="left" title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window>
 <zscript>
     Page center= desktop.getPage("mainPage");
 </zscript>
<vbox> 
    <button label="Rules" onClick="" image='/main/Images/rules_gear.ico' width="90px"/>
    <button label="Admin" onClick="Executions.sendRedirect("/main/frames/admin_users.zul")" image='/main/Images/admin.ico' width="90px"/>
    <button label="Statistics" onClick="" image='/main/Images/stat.ico' width="90px"/>
</vbox>
</window>
</zk>

Thanks in advance!

Oleg

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-11-08 10:29:17 +0800

twiegand gravatar image twiegand
1807 3

Pektop,

Unless you have a specific requirement, perhaps you should consider changing the <iframe> to an <include>.

Regards,

Todd

link publish delete flag offensive edit

answered 2010-11-08 11:12:13 +0800

pektop gravatar image pektop
6

Thanks Todd!
Simple solution is always the best solution. I moved buttons to main.zul file and with with <include> directive redirection works fine. Thanks again.

BR
Oleg

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-11-08 04:40:38 +0800

Seen: 727 times

Last updated: Jul 01

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More