Skip to content

Commit

Permalink
onSelect=#list
Browse files Browse the repository at this point in the history
  • Loading branch information
simbo1905 committed May 7, 2012
1 parent 8f50866 commit ef4e8b2
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/main/java/org/zkforge/zktodo2/ui/Presenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<SelectEvent<Listitem, Reminder>>(){
@Override
public void onEvent(SelectEvent<Listitem, Reminder> 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<Listitem, Reminder> e){
selectedReminder = e.getSelectedObjects().iterator().next();
date.setValue(selectedReminder.getDate());
priority.setValue(selectedReminder.getPriority());
name.setValue(selectedReminder.getName());
return;
}

@Listen("onClick = #add")
Expand Down

0 comments on commit ef4e8b2

Please sign in to comment.