1

Cross context can't find zul composer

asked 2014-06-16 10:15:05 +0800

Neus gravatar image Neus
1415 14

Hi, I have two applications with cross context because they share some resources. I need to open a modal window from App1 which .zul is in App2.

I create the window this way:

    (Window)Executions.createComponents("~StsUtilidades/recursos/Utilidades/Usuarios/MaestroPerfilUsuario.zul",null,null);

But it throws an exception saying that the composer's class of the modal window cannot be found. I imagine it is searching the class in App1 (from where the .zul is called) instead of searching it in App2 (where the .zul is located).

How can I solve it??

Thank you very much!

delete flag offensive retag edit

Comments

what is the exception?

chillworld ( 2014-06-17 05:39:34 +0800 )edit

It's a ClassNotFoundException

Neus ( 2014-06-17 07:51:26 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-06-17 08:12:47 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

Neus,

Your problem is that that the controller is inside the second application and you create it in your application.
You could make a kind of framework(jar) for the controllers who are shared.

Other solution can be an include and give the url from your other application.
This should be no problem as long you don't have an authentication in your other application.

Greetz chill.

link publish delete flag offensive edit

Comments

Finally I made a jar with all the controllers for the shared zuls. Thank you!

Neus ( 2014-06-17 14:48:03 +0800 )edit

your welcome

chillworld ( 2014-06-17 15:29:25 +0800 )edit

very good!

mhj ( 2014-06-17 18:40:58 +0800 )edit
0

answered 2014-06-17 00:13:32 +0800

mhj gravatar image mhj flag of Brazil
806 1 7

Hello Neus, I think you need to put the second parameter (parent). look at this example:

                dataRow.addEventListener(Events.ON_DOUBLE_CLICK, new EventListener<Event>() {
                @Override
                public void onEvent(Event event) throws Exception {
                    ContactTreeNode clickedNodeValue = (ContactTreeNode) ((Treeitem) event.getTarget().getParent())
                            .getValue();
                    Window w = new Window("ZK IM - " + ((Contact) clickedNodeValue.getData()).getName(), "normal",
                            true);
                    w.setPosition("parent");
                    w.setParent(demoWindow);
                    HashMap<String, String> dataArgs = new HashMap<String, String>();
                    dataArgs.put("name", clickedNodeValue.getData().getName());
                    Executions.createComponents("/widgets/tree/dynamic_tree/dialog.zul", w, dataArgs);
                    w.doOverlapped();
                }
            });

in this fiddle there is a simple example too: Executions-createComponents

I hope that helps you...

link publish delete flag offensive edit

Comments

The exception only happens if I try to create a component from another project. In App1 I try to create a component which zul is inside App2

Neus ( 2014-06-17 07:53:39 +0800 )edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-06-16 10:15:05 +0800

Seen: 19 times

Last updated: Jun 17 '14

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