Merge branch 'master' of https://git.bukova.info/repos/git/isspst
commit
aa8a0ebd2a
@ -1,10 +1,14 @@
|
||||
package info.bukova.isspst.services.requirement;
|
||||
|
||||
import info.bukova.isspst.data.RequirementType;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RequirementTypeService extends Service<RequirementType> {
|
||||
|
||||
public RequirementType getTypeById(String id);
|
||||
public List<Workgroup> filterCentres(RequirementType reqType, List<Workgroup> source);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package info.bukova.isspst.ui.requirement;
|
||||
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.ExecutionArgParam;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import info.bukova.isspst.data.RequirementType;
|
||||
import info.bukova.isspst.data.Workgroup;
|
||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||
import info.bukova.isspst.ui.ListChecks;
|
||||
|
||||
public class OfferedCentresVM {
|
||||
|
||||
private RequirementType selectedType;
|
||||
@WireVariable
|
||||
private WorkgroupService workgroupService;
|
||||
private ListChecks<Workgroup> wgChecks;
|
||||
|
||||
@Init
|
||||
public void init(@ExecutionArgParam("type") RequirementType type) {
|
||||
this.selectedType = type;
|
||||
wgChecks = new ListChecks<Workgroup>(selectedType.getOfferedCentres(), workgroupService.getCentres());
|
||||
}
|
||||
|
||||
@Command
|
||||
public void save(@BindingParam("window") Window window) {
|
||||
window.detach();
|
||||
}
|
||||
|
||||
public boolean isCanSave() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public RequirementType getSelectedType() {
|
||||
return selectedType;
|
||||
}
|
||||
|
||||
public void setSelectedType(RequirementType selectedType) {
|
||||
this.selectedType = selectedType;
|
||||
}
|
||||
|
||||
public ListChecks<Workgroup> getWgChecks() {
|
||||
return wgChecks;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?page title="${labels.OfferedCentres}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
<window border="normal" apply="org.zkoss.bind.BindComposer"
|
||||
id="editWin"
|
||||
width="500px"
|
||||
closable="true"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.requirement.OfferedCentresVM')">
|
||||
|
||||
<caption zclass="form-caption" label="${labels.OfferedCentres}" />
|
||||
|
||||
<vbox children="@load(vm.wgChecks.checks)">
|
||||
<template name="children">
|
||||
<checkbox label="@load(each.member)" checked="@bind(each.checked)"/>
|
||||
</template>
|
||||
</vbox>
|
||||
<include src="/app/formButtons.zul" />
|
||||
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue