Exemplo n.º 1
0
  private ComboBox getForma() {
    FieldDef[] campos =
        new FieldDef[] {
          new IntegerFieldDef("pokerFormaId"),
          new StringFieldDef("pokerFormaNome"),
          new BooleanFieldDef("pokerFormaRealizado"),
          new BooleanFieldDef("pokerFormaJackpot")
        };
    CoreProxy<PokerForma> proxy = new CoreProxy<PokerForma>(new PokerForma());
    Store store = new Store(proxy, new ArrayReader(new RecordDef(campos)), false);

    cmbForma = new ComboBox(OpenSigCore.i18n.txtTipo(), "pokerForma.pokerFormaNome", 130);
    cmbForma.setAllowBlank(false);
    cmbForma.setStore(store);
    cmbForma.setTriggerAction(ComboBox.ALL);
    cmbForma.setMode(ComboBox.REMOTE);
    cmbForma.setMinChars(1);
    cmbForma.setDisplayField("pokerFormaNome");
    cmbForma.setValueField("pokerFormaId");
    cmbForma.setForceSelection(true);
    cmbForma.setEditable(false);
    cmbForma.setListWidth(130);
    cmbForma.addListener(
        new ComboBoxListenerAdapter() {
          public void onSelect(ComboBox comboBox, Record record, int index) {
            hdnForma.setValue(comboBox.getValue());
            jackpot = record.getAsBoolean("pokerFormaJackpot");
            if (record.getAsBoolean("pokerFormaRealizado")) {
              pago = true;
              dtRealizado = new Date();
            } else {
              pago = false;
              dtRealizado = null;
            }
          }

          public void onBlur(Field field) {
            if (cmbForma.getRawValue().equals("")) {
              hdnForma.setValue("0");
            }
          }
        });

    return cmbForma;
  }
Exemplo n.º 2
0
  private ComboBox getCash() {
    FieldDef[] campos =
        new FieldDef[] {new IntegerFieldDef("pokerCashId"), new StringFieldDef("pokerCashMesa")};
    FiltroBinario fb = new FiltroBinario("pokerCashFechado", ECompara.IGUAL, 0);
    CoreProxy<PokerCash> proxy = new CoreProxy<PokerCash>(new PokerCash(), fb);
    Store store = new Store(proxy, new ArrayReader(new RecordDef(campos)), false);

    cmbCash = new ComboBox(OpenSigCore.i18n.txtCash(), "pokerCash.pokerCashMesa", 130);
    cmbCash.setAllowBlank(false);
    cmbCash.setStore(store);
    cmbCash.setTriggerAction(ComboBox.ALL);
    cmbCash.setMode(ComboBox.REMOTE);
    cmbCash.setDisplayField("pokerCashMesa");
    cmbCash.setValueField("pokerCashId");
    cmbCash.setTpl(
        "<div class=\"x-combo-list-item\"><b>"
            + OpenSigCore.i18n.txtCod()
            + " {pokerCashId}</b> - <i>"
            + OpenSigCore.i18n.txtMesa()
            + " {pokerCashMesa}</i></div>");
    cmbCash.setForceSelection(true);
    cmbCash.setEditable(false);
    cmbCash.setListWidth(200);
    cmbCash.addListener(
        new ComboBoxListenerAdapter() {
          public void onSelect(ComboBox comboBox, Record record, int index) {
            hdnCash.setValue(comboBox.getValue());
          }

          public void onBlur(Field field) {
            if (cmbCash.getRawValue().equals("")) {
              hdnCash.setValue("0");
            }
          }
        });

    return cmbCash;
  }