0

Composer and Event Listener Autowiring Question

asked 2011-11-04 13:20:45 +0800

carpolva gravatar image carpolva
155 4

Hi guys.

I have a concrete question about composer autowiring based on the given explanation in this page: http://books.zkoss.org/wiki/ZK_Component_Reference/Common_Operations/Event_Handling/Event_Listening#Composer_and_Event_Listener_Autowiring

I have a Listbox:

<window id="win" width="1930px" apply="${MyBean}">
    <listbox id="generalList" model="@{win$composer.gralListModel, load-after='btnAdd.onClick,btnDelete.onClick'}">
         ...
         ...
    </listbox>
</window>

where listBox ID is "generalList", right?. I want to do something when listbox is created, so I used the following:

<listbox id="generalList" model="@{win$composer.gralListModel, load-after='btnAdd.onClick,btnDelete.onClick'}">
      <attribute name="onCreate"><![CDATA[
                          ... do something
        ]]></attribute>
</listbox>

Based on performance tips, the previous example will be interpreted as ZSCRIPT (am I right?)... so I tried to use the autowiring feature like the following:

MyBean.java

public class MyBean extends GenericForwardComposer{

      public void onCreate$generalList() {
		//do something...
      }
}

But it didn't work, the listbox is loaded on screen and never enters to this method... am I missing something or the autowiring feature only works for specific methods?

Thanks for any help.

Regards.

delete flag offensive retag edit
Be the first one to reply this discussion!
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: 2011-11-04 13:20:45 +0800

Seen: 198 times

Last updated: Nov 04 '11

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