19 package org.turro.newsletter;
21 import org.turro.composer.EntityPathComposer;
22 import org.turro.publication.entity.NewsSection;
23 import org.zkoss.zk.ui.Component;
24 import org.zkoss.zk.ui.Executions;
25 import org.zkoss.zk.ui.event.Event;
26 import org.zkoss.zk.ui.event.Events;
27 import org.zkoss.zk.ui.select.annotation.Listen;
28 import org.zkoss.zk.ui.select.annotation.Wire;
29 import org.zkoss.zul.Checkbox;
30 import org.zkoss.zul.Textbox;
41 private Checkbox column;
44 private Textbox colWidth;
46 @Wire(
"#useAsTrigger")
47 private Checkbox useAsTrigger;
50 private Checkbox hideIfEmpty;
52 @Listen(
"onCheck = #column")
54 entity.setNewColumn(column.isChecked());
55 colWidth.setReadonly(!column.isChecked());
56 Events.postEvent(
new Event(Events.ON_CHANGE));
59 @Listen(
"onChange = #colWidth")
61 entity.setWidth(colWidth.getValue());
62 Events.postEvent(
new Event(Events.ON_CHANGE));
65 @Listen(
"onCheck = #useAsTrigger")
67 entity.setUseAsTrigger(useAsTrigger.isChecked());
68 Events.postEvent(
new Event(Events.ON_CHANGE));
71 @Listen(
"onCheck = #hideIfEmpty")
73 entity.setHideIfEmpty(hideIfEmpty.isChecked());
74 Events.postEvent(
new Event(Events.ON_CHANGE));
77 @Listen(
"onClick = #mvup")
80 Events.postEvent(
new Event(Events.ON_CHANGE));
83 @Listen(
"onClick = #mvdown")
86 Events.postEvent(
new Event(Events.ON_CHANGE));
89 @Listen(
"onClick = #delete")
92 Events.postEvent(
new Event(Events.ON_CHANGE));
97 super.doAfterCompose(comp);
98 grid = (
SectionsGrid) Executions.getCurrent().getAttribute(
"grid");
99 column.setChecked(
entity.isNewColumn());
100 useAsTrigger.setChecked(
entity.isUseAsTrigger());
101 hideIfEmpty.setChecked(
entity.isHideIfEmpty());
102 colWidth.setReadonly(!column.isChecked());
void doAfterCompose(Component comp)
void moveDown(NewsSection newsSection)
void moveUp(NewsSection newsSection)
void deleteSection(NewsSection newsSection)