load-after doesn't work?

asked 2009-05-15 04:19:40 +0800

hawk gravatar image hawk
3185 1 5
http://hawkphoenix.blogsp... ZK Team

Hi, everyone:

because of some browser reloading problem, I have to use load-after attribute.
But after I use breakpoint to observe the event handling order in eclipse, I found even I use load-after on 'model' attribute, it still get data before event handling. So, my zul page(listbox) still doesn't get updated after users modify data.
do I misunderstand the document?

this is my zul page:
*I apply a GenericAutowireComposer which is a spring bean.
*a listbox show summary column, and the following show all columns.
* before using 'load-after', I send a self-defined event after onDelete() like:
Events.sendEvent(new Event("onAfterClick",delete));
but it seems to have exception after users reload browser, so I come to use load-after in 3.6.1.

<?page title="" contentType="text/html;charset=UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window border="normal" apply="${employeeComposer}">
<listbox id="eListbox"
model="@{employeeComposer.employees, load-after='add.onClick, save.onClick,delete.onClick'}"
mold="paging" pageSize="10" selectedItem="@{employeeComposer.selectedEmployee}" >
<listheader label="id" visible="false" />
<listheader label="姓名" sort="auto(name)" width="80px"/>
<listheader label="email" sort="auto(email)"/>
<listheader label="分機" sort="auto(extension)" width="50px" />
<listheader label="帳號" sort="auto(account)" />
<listheader label="權限" sort="auto(role)" />
<listheader label="啟用" sort="auto(enabled)" />
<listitem self="@{each=e}">
<listcell label="@{e.id}" visible="false" />
<listcell label="@{e.name}" />
<listcell label="@{e.email}" />
<listcell label="@{e.extension}"/>
<listcell label="@{e.account}" />
<listcell label="@{e.role}" />
<listcell label="@{e.enabled}" />
<row>姓名:<textbox id="name" cols="10"
value="@{employeeComposer.selectedEmployee.name,load-after=reset.onClick}" />
<textbox id="email" cols="30"
constraint="/.+@.+\.+/: 請輸入正確email格式" />
<textbox id="extension" cols="5" maxlength="5"
<textbox id="account" cols="15" forward="onBlur=onAccountChange"
value="@{employeeComposer.selectedEmployee.account,load-after=reset.onClick}" />
<row>密碼:<!-- it might need to make all passwords the same length -->
<textbox id="password" cols="15" type="password" maxlength="15"
value="@{employeeComposer.selectedEmployee.password,load-after=reset.onClick}" />
<combobox id="role" selectedItem="@{employeeComposer.selectedEmployee.role,load-after=reset.onClick}">
<comboitem label="ROLE_STAFF" value="ROLE_STAFF" description="員工"/>
<comboitem label="ROLE_ADMIN" value="ROLE_ADMIN" description="管理員"/>

<checkbox id="enabled" checked="@{employeeComposer.selectedEmployee.enabled,load-after=reset.onClick}" />

<button id="add" label="Add" forward="onAdd"/>
<button id="save" label="Save" forward="onSave"/>
<button id="delete" label="Delete" forward="onDelete"/>
<button id="reset" label="Reset" forward="onReset"/>

do I have make any mistake in my zul?

delete flag offensive retag edit

1 Reply

Sort by » oldest newest

answered 2009-05-15 09:00:43 +0800

robertpic71 gravatar image robertpic71
1275 1

Maybe there was a bug. Check this bug.


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




Asked: 2009-05-15 04:19:40 +0800

Seen: 447 times

Last updated: May 15 '09

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