19 package org.turro.dossier.grant;
21 import java.util.stream.Collectors;
22 import org.turro.string.Strings;
23 import org.turro.dossier.db.DossierPU;
24 import org.turro.dossier.entity.ProjectGrant;
25 import org.turro.dossier.zul.menu.DossierMenu;
26 import org.turro.elephant.context.Application;
27 import org.turro.jpa.composer.EntityComposer;
28 import org.turro.jpa.entity.DaoEntity;
29 import org.turro.tags.TagItem;
30 import org.turro.tags.Tags;
31 import org.turro.tags.TagsChosenbox;
32 import org.turro.zkoss.text.WikiEditor;
33 import org.turro.zul.frame.Framework;
34 import org.zkoss.zk.ui.Component;
35 import org.zkoss.zk.ui.event.InputEvent;
36 import org.zkoss.zk.ui.select.annotation.Listen;
37 import org.zkoss.zk.ui.select.annotation.Wire;
46 @Wire(
"#deadline")
private WikiEditor deadline;
47 @Wire(
"#beneficiaries")
private WikiEditor beneficiaries;
48 @Wire(
"#elegible")
private WikiEditor elegible;
49 @Wire(
"#features")
private WikiEditor features;
50 @Wire(
"#intensity")
private WikiEditor intensity;
53 @Listen(
"onChange = #goal")
59 @Listen(
"onChange = #deadline")
65 @Listen(
"onChange = #beneficiaries")
71 @Listen(
"onChange = #elegible")
77 @Listen(
"onChange = #features")
83 @Listen(
"onChange = #intensity")
89 @Listen(
"onSearch = #detail #tags")
91 String value =
event.getValue();
92 if(!Strings.isBlank(value)) {
99 return "projectGrant";
125 return super.beforeSave();
133 .stream().map(s -> s.getTagName()).collect(Collectors.toSet()));
143 if(
entity.getBeneficiaries() !=
null) beneficiaries.
setValue(
entity.getBeneficiaries().getWiki());
147 tags.setCreatable(
false);
153 return !
entity.isEmpty() && (
entity.getId() ==
null ||
entity.getId() == 0) || super.shouldBeSaved();
static String getObjectPath(Object object)
void onNewTag(InputEvent event)
void onBeneficiariesChange()
String getAttributeName()
ProjectGrant getEntityInstance(Long id)
DaoEntity getWrapperInstance(Component comp)
boolean isInRole(String role)
static Application getApplication()
void setValue(String value)
static Framework getCurrent()
void setSelectedLabel(String text)
void setSelectedTooltiptext(String text)