From ef4e8b25473db9845c552f77a96203888e3619ac Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Mon, 7 May 2012 18:06:30 +0100 Subject: [PATCH] onSelect=#list --- .../org/zkforge/zktodo2/ui/Presenter.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/zkforge/zktodo2/ui/Presenter.java b/src/main/java/org/zkforge/zktodo2/ui/Presenter.java index 056c8eb..c3713e5 100644 --- a/src/main/java/org/zkforge/zktodo2/ui/Presenter.java +++ b/src/main/java/org/zkforge/zktodo2/ui/Presenter.java @@ -9,7 +9,6 @@ import org.zkforge.zktodo2.Reminder; import org.zkforge.zktodo2.ReminderService; import org.zkoss.zk.ui.event.Event; -import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.SelectEvent; import org.zkoss.zk.ui.select.SelectorComposer; import org.zkoss.zk.ui.select.annotation.Listen; @@ -60,17 +59,15 @@ public void doAfterCompose(Window comp) throws Exception { listModelList.addAll(reminders); list.setModel(listModelList); list.setItemRenderer(this); - list.addEventListener("onSelect", new EventListener>(){ - @Override - public void onEvent(SelectEvent event) throws Exception { - selectedReminder = event.getSelectedObjects().iterator().next(); - date.setValue(selectedReminder.getDate()); - priority.setValue(selectedReminder.getPriority()); - name.setValue(selectedReminder.getName()); - return; - } - } - ); + } + + @Listen("onSelect = #list") + public void select(SelectEvent e){ + selectedReminder = e.getSelectedObjects().iterator().next(); + date.setValue(selectedReminder.getDate()); + priority.setValue(selectedReminder.getPriority()); + name.setValue(selectedReminder.getName()); + return; } @Listen("onClick = #add")