-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi guys,
Here is my ZUML and sample code:
<listbox id="eListbox" model="@{employeeComposer.employees, load-when='add.onClick'}"
selectedItem="@{employeeComposer.selectedEmployee}">
...
<hbox>
<button id="add" label="Add" forward="onAdd"/>
<button id="save" label="Update" forward="onSave"/>
<button id="enable" label="Enable" forward="onEnable"/>
<button id="disable" label="Disable" forward="onDisable"/>
<button id="delete" label="Delete" forward="onDelete"/>
<button id="reset" label="Reset" forward="onReset"/>
</hbox>
..
public class EmployeeComposer extends GenericAutowireComposer {
...
public void onAdd(){
employeeDAO.insert(selectedEmployee);
}
public void onSave(){
employeeDAO.update(selectedEmployee);
}
public void onEnable(){
employeeDAO.enable(selectedEmployee);
}
public void onDisable(){
employeeDAO.disable(selectedEmployee);
}
public void onDelete(){
employeeDAO.delete(selectedEmployee);
}
}
I want to refresh the page when user click add button.
I use load-when attribute but I found it load data before user click add button, so it won't load the latest data from database.
Currently, I know a solution is to add one line in each event handler method:
Executions.getCurrent().sendRedirect(null);
is there a solution without writing code? (just modify ZUML)
thanks.
Time is the cure.
The lifecyle of load-when and forward event will be rearranged in near future.
Asked: 2009-04-16 04:11:15 +0800
Seen: 444 times
Last updated: Apr 17 '09