18 package org.turro.erp.aptitude;
20 import java.util.Collection;
21 import org.turro.elephant.context.Application;
22 import org.turro.erp.db.ErpPU;
23 import org.turro.erp.menu.ErpMenu;
24 import org.turro.erp.entity.Aptitude;
25 import org.turro.erp.entity.AptitudeDegree;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.turro.zkoss.label.LabelTypes;
28 import org.turro.elephant.zkoss.ElLabel;
29 import org.zkoss.zk.ui.event.Event;
30 import org.zkoss.zk.ui.event.EventListener;
31 import org.zkoss.zk.ui.event.Events;
32 import org.zkoss.zk.ui.ext.AfterCompose;
33 import org.zkoss.zul.A;
34 import org.zkoss.zul.Column;
35 import org.zkoss.zul.Columns;
36 import org.zkoss.zul.Label;
37 import org.zkoss.zul.Row;
38 import org.zkoss.zul.Rows;
39 import org.zkoss.zul.Vlayout;
57 private void addRows() {
60 Collection<Aptitude> list =
new ErpPU().getResultList(
61 "select aptitude from Aptitude as aptitude " +
62 "order by aptitude.name");
64 Rows rows =
new Rows();
69 rows.appendChild(row);
70 row.appendChild(
new Label(o.getId() +
""));
72 Vlayout vbox =
new Vlayout();
73 row.appendChild(vbox);
75 A b =
new A(o.getName());
76 if(app.
isInRole(
"erp-config:edit")) {
77 b.addEventListener(Events.ON_CLICK,
new EventListener() {
79 public void onEvent(Event event)
throws Exception {
86 if(!o.getAptitudeDegrees().isEmpty()) {
87 for(AptitudeDegree od : o.getAptitudeDegrees()) {
88 vbox.appendChild(LabelTypes.getSoftLabel(od.getFullDescription()));
96 private void addColumns() {
97 Columns cols =
new Columns();
100 Column col =
new Column(
"#",
null,
"50px");
101 cols.appendChild(col);
103 col =
new Column(Application.getString(
"lName"));
104 cols.appendChild(col);
boolean isInRole(String role)
static Application getApplication()
void setRowCount(int rows)