0

org.zkoss.zk.ui.UiException: Error in method invocation: Method

asked 2017-02-10 00:16:02 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
86 1 5

updated 2017-02-10 00:29:52 +0800

I am facing a weird behavior i will try to explain in because is a little complicated.

I have multiple tabs like 2.

In the first tab i have a structure like this

Tab->Window->Window->Toolbar like 5 buttons each of them with a structure like their parent i mean Window->Window when the 1 window is just a container.

The 2 tab have a structure like the 1 i mean Tab->Window->Window. In this tab when the user try to close the tab i show a modal window like

Save Not Save Cancel

This window is just a ZK Window class.

I am facing problems when the user clicks on the not save option because when this happens i remove the tab i move to the previuos tab[the one with the toolbar] i execute the refresh(some code) on the selected window i mean the toolbarbutton being show like this

final Window window = findTheWindowSelectedInTheToolbarButton(tab);

In the code i have this stuff.

 <customwindow id='win'>  
    //zscript
   final Action refresh = new Action(){
   public void execute(){      
       win.execute();//win references to customwindow
}
};
 </customwindow>

in the class i have a method like

public final CustomWindow extends Window{
public void execute(){
}

When i print before executing a action on the window i mean a window data refresh i have something like this.

final Action refresh = new Action(){
public void execute(){
  win.execute();//win is the window the container of type CustomWindow
}
};

This always works OK even when i print the Window stuff after this code

final Window window = findTheWindowSelectedInTheToolbarButton();
System.out.println(window instanceof CustomWindow);//print true
System.out.println(window.getAttribute("id"));//prints id everything is ok

But when i execute

refreshAction.execute();

I am receiving the exception

**method .execute is not present in Window class** even i try to print everything from win object in the zul code and i see like Window is a object of type the window i already close i mean the window nested in the second tab.. like this

final Action refresh = new Action(){
public void execute(){
      System.out.println(win.getAttribute("id"));//prints everything related from the window i already close
      System.out.println(win.getAttribute("info"));
  win.execute();
}
};

why this if i extract the attribute from the window and i execute the refresh action but Win references to the win on the tab i did close???

What can i do i know this is confusing thanks a lot and god bless.

delete flag offensive retag edit
Be the first one to answer this question!
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: 2017-02-10 00:16:02 +0800

Seen: 21 times

Last updated: Feb 10