Exemplo n.º 1
0
 private void loadSemester() throws Exception {
   cmbSemester.getItems().clear();
   Comboitem item1 = new Comboitem();
   item1.setValue(1);
   item1.setLabel("Gasal (1)");
   cmbSemester.appendChild(item1);
   Comboitem item2 = new Comboitem();
   item2.setValue(2);
   item2.setLabel("Genap (2)");
   cmbSemester.appendChild(item2);
 }
Exemplo n.º 2
0
 private void loadTahun() throws Exception {
   int currentYear = new DateTime().getYear();
   cmbTahun.getItems().clear();
   Comboitem item = new Comboitem();
   item.setValue("");
   item.setLabel("-- Pilih Tahun --");
   cmbTahun.appendChild(item);
   for (int x = 2000; x <= currentYear; x++) {
     Comboitem itm = new Comboitem();
     itm.setValue(x);
     itm.setLabel(x + "");
     cmbTahun.appendChild(itm);
   }
 }
 private void loadJenjangStudi() throws Exception {
   try {
     JenjangStudiDAO dao = new JenjangStudiDAOImpl();
     List<JenjangStudi> jenjangStudi = dao.getUnfinised();
     cmbJenjangStudi.getItems().clear();
     Comboitem item = new Comboitem();
     item.setValue(null);
     item.setLabel("Semua");
     cmbJenjangStudi.appendChild(item);
     for (JenjangStudi o : jenjangStudi) {
       Comboitem items = new Comboitem();
       items.setValue(o);
       items.setLabel(o.getNama());
       cmbJenjangStudi.appendChild(items);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   }
 }
 private void loadProgdi() throws Exception {
   try {
     UKProgramStudiDAO dao = new UKProgramStudiDAOImpl();
     List<UKProgramStudi> progdis = dao.gets();
     cmbProgdi.getItems().clear();
     Comboitem item = new Comboitem();
     item.setValue(null);
     item.setLabel("--Pilih Prodi--");
     cmbProgdi.appendChild(item);
     for (UKProgramStudi ps : progdis) {
       Comboitem items = new Comboitem();
       items.setValue(ps);
       items.setLabel(ps.getShortKode() + " " + ps.getNama());
       cmbProgdi.appendChild(items);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   }
 }
Exemplo n.º 5
0
 private void fillCombo(final Combobox combo, final Locale curLocale) {
   if (combo.getItemCount() == 0) {
     final Locale currentLocale = UISessionUtils.getCurrentSession().getLocale();
     for (final Locale locale : getPlayerFacade().getAllCountries()) {
       final Comboitem item = new Comboitem(locale.getDisplayCountry(currentLocale));
       item.setValue(locale);
       combo.appendChild(item);
       if (curLocale.getCountry().equals(locale.getCountry())) {
         combo.setSelectedItem(item);
       }
     }
   }
 }
Exemplo n.º 6
0
  public void onSelect$serieCombo() {

    s = ((Serie) serieCombo.getSelectedItem().getValue());
    turmaCombo.getChildren().clear();
    for (Turma t : Facade.getInstance().listarTurmaSerie(s.getId(), anoletivoObj.getId())) {
      Comboitem comboitem = new Comboitem();
      comboitem.setLabel(t.getNome());
      comboitem.setValue(t);
      turmaCombo.appendChild(comboitem);
    }

    turmaCombo.setDisabled(false);
    binder.loadComponent(RowTurma);
  }
Exemplo n.º 7
0
  public void onSelect$nivelCombo(Event e) {

    ne1 = ((NivelEscolar) nivelCombo.getSelectedItem().getValue());
    serieCombo.getChildren().clear();
    for (Serie se : Facade.getInstance().listarSerieNivel(ne1.getId())) {
      Comboitem comboitem = new Comboitem();
      comboitem.setLabel(se.getDescricao());
      comboitem.setValue(se);
      serieCombo.appendChild(comboitem);
    }

    serieCombo.setDisabled(false);
    binder.loadComponent(RowSerie);
  }
Exemplo n.º 8
0
 private void loadProgdi() throws Exception {
   try {
     ProgramStudiDAO dao = new ProgramStudiDAOImpl();
     List<ProgramStudi> progdis = dao.getProgramStudi();
     cmbProgdi.getItems().clear();
     for (ProgramStudi ps : progdis) {
       Comboitem items = new Comboitem();
       items.setValue(ps);
       items.setLabel(ps.getKode() + " " + ps.getNama());
       cmbProgdi.appendChild(items);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   }
 }
Exemplo n.º 9
0
 public void loadDosenOnChanging(String nama) throws Exception {
   try {
     DosenDAO dao = new DosenDAOImpl();
     List<Dosen> dosens =
         dao.getsByName(nama, (ProgramStudi) cmbProgdi.getSelectedItem().getValue());
     cmbNamaDosen.getItems().clear();
     for (Dosen d : dosens) {
       Comboitem items = new Comboitem();
       items.setValue(d);
       items.setLabel(d.getNama());
       cmbNamaDosen.appendChild(items);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   }
 }
Exemplo n.º 10
0
  public void onSelect$anoLetivoCombo(Event e) throws InterruptedException {

    anoletivoObj = (AnoLetivo) anoLetivoCombo.getSelectedItem().getValue();

    nivelCombo.getChildren().clear();
    for (NivelEscolar ne : Facade.getInstance().listarNivelEscolar()) {
      // funciona como um GROUP BY para que não sejam repetidos os mesmos níveis no combobox

      Comboitem comboitem = new Comboitem();
      comboitem.setLabel(ne.getNivel());
      comboitem.setValue(ne);
      nivelCombo.appendChild(comboitem);
    }
    nivelCombo.setDisabled(false);
    binder.loadComponent(RowNivel);
  }
Exemplo n.º 11
0
 public void loadDosen() throws Exception {
   try {
     cmbNamaDosen.setValue("");
     DosenDAO dao = new DosenDAOImpl();
     List<Dosen> dosens = dao.getsByProdi((ProgramStudi) cmbProgdi.getSelectedItem().getValue());
     cmbNamaDosen.getItems().clear();
     for (Dosen d : dosens) {
       Comboitem items = new Comboitem();
       items.setValue(d);
       items.setLabel(d.getNama());
       cmbNamaDosen.appendChild(items);
     }
   } catch (Exception ex) {
     ex.printStackTrace();
     Messagebox.show(ex.getMessage());
   }
 }
 private void loadKecamatan() throws Exception {
   Connection conn = getConn();
   try {
     KecamatanDAO dao = new KecamatanDAOImpl(conn);
     cmbKecamatan.getItems().clear();
     for (Kecamatan kec : dao.gets()) {
       Comboitem item = new Comboitem();
       item.setValue(kec);
       item.setLabel(kec.getNama());
       cmbKecamatan.appendChild(item);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   } finally {
     conn.close();
   }
 }