0

transferring control to new page from current page in zul code

asked 2012-10-16 18:29:11 +0800

dougraider gravatar image dougraider
16 1

I am trying to transfer to another screen from my composer page, after the user clicks the "edit" button.

I want to make the transfer in this program, not in the xml part.

I have displayed a list of items and an edit button next to each. When the user clicks the "edit" button, I want to transfer to another zul page and composer for a detail screen. I have tried the "events." command, but no luck yet. I am a newbie Grails/Groovy/ZK developer.

Any help you can give would be appreciated. If this is not posted in the correct place, please let me know.

Thanks in advance for your help!

Doug Bell

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2012-10-17 20:12:46 +0800

dougraider gravatar image dougraider
16 1

Justin and Senthilchettyin,

Thanks a bunch. I was able to make my code work correctly using the "Executions.sendRedirect" command.

I appreciate all your help and I'll be looking through your blog, Senthilchettyin!

Doug

link publish delete flag offensive edit

answered 2012-10-17 13:03:29 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

For new newbie, you can also refer my blog http://emrpms.blogspot.in/

link publish delete flag offensive edit

answered 2012-10-17 07:12:24 +0800

JustinFrost gravatar image JustinFrost
145 1 6

Hi Doug,

I am also a newbie. But I have discovered a couple of methods to do this in the java code:

1. Change the include src
if you .zul file is included as such

<window id="contentWindow" border="none" width="100%" apply="controller.contentWindowController">
        	<vlayout spacing="5px">
                    <include id="content" src="/content/details.zul" />
                    <button id="editButton" label="edit"  />
                </vlayout>
</window>

then you can simply change the src of the include on the click of the button in your controller class:

	@Listen("onClick = #editButton")
	public void redirectPage(){
		try{
			content.setSrc("/content/generic/message.zul");
		}
		catch (Exception e){
		}
	}


2. Redirect your browser on the click of the button in your controller class

    @Listen("onClick = #editButton")
    public void redirectHome(){
        Executions.sendRedirect("/edit.zul");
    }

However this method will change the url of your browser to the passed url.

In both instances you can pass parameters to the url, for example edit.zul?parm1=p2&parm2=p2

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: 2012-10-16 18:29:11 +0800

Seen: 83 times

Last updated: Oct 17 '12

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