0

Know the .zul with the apply

asked 2012-11-26 08:02:23 +0800

Neus gravatar image Neus
1415 14

updated 2013-01-24 08:17:21 +0800

Hi, I'm trying to know in which .zul a user is doing actions. Now I'm using page.getRequestedPath() but it only works if the user is not working inside a modal window. Imagine that the user is working on a page and something go wrong. He could send me an email and some of the thing I want to know are informed automatically. One of this things is the .zul where the application has failed. So if it happens in a page that it is not a modal window I can get the zul, but if it happens in a modal window i don't know how to get the zul which this modal window belongs to.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2013-01-23 14:20:13 +0800

neillee gravatar image neillee flag of Taiwan
1692 1 5
https://plus.google.com/u...

Here is an example. Run the example first, then move the apply attribute from index.zul to included.zul and try again.

index.zul

<zk>
    <include src="included.zul"/>
    <window border="normal" title="hello" apply="pkg$.TestComposer">    
        <div>Welcome to ZK Fiddle , run it right now!</div>     
    </window>
</zk>

included.zul

<window border="normal" title="hello" >
<div>Welcome to ZK Fiddle , run it right now!</div>
</window>

TestComposer.java

package pkg$;
// imports omitted
public class TestComposer extends GenericForwardComposer {
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        Component root = comp.getRoot();
        if (root instanceof Include)
            Messagebox.show(((Include)root).getSrc());
        else
            Messagebox.show(root.getPage().getRequestPath());
    }
}
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-11-26 08:02:23 +0800

Seen: 117 times

Last updated: Jan 24 '13

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