private ComboBox getCliente() { FieldDef[] campos = new FieldDef[] { new IntegerFieldDef("pokerClienteId"), new IntegerFieldDef("pokerClienteCodigo"), new StringFieldDef("pokerClienteNome") }; FiltroBinario fb = new FiltroBinario("pokerClienteAtivo", ECompara.IGUAL, 1); CoreProxy<PokerCliente> proxy = new CoreProxy<PokerCliente>(new PokerCliente(), fb); Store store = new Store(proxy, new ArrayReader(new RecordDef(campos))); cmbCliente = new ComboBox(OpenSigCore.i18n.txtDescricao(), "pokerPagarDescricao", 180); cmbCliente.setAllowBlank(false); cmbCliente.setStore(store); cmbCliente.setTriggerAction(ComboBox.ALL); cmbCliente.setMode(ComboBox.REMOTE); cmbCliente.setDisplayField("pokerClienteNome"); cmbCliente.setValueField("pokerClienteId"); cmbCliente.setForceSelection(false); cmbCliente.setEditable(true); cmbCliente.setMinChars(1); cmbCliente.setTypeAhead(true); cmbCliente.setListWidth(200); return cmbCliente; }
private ComboBox getConta() { FieldDef[] fdConta = new FieldDef[] { new IntegerFieldDef("finContaId"), new IntegerFieldDef("empEmpresa.empEmpresaId"), new StringFieldDef("empEmpresa.empEntidade.empEntidadeNome1"), new IntegerFieldDef("finBanco.finBancoId"), new StringFieldDef("finBanco.finBancoDescricao"), new StringFieldDef("finContaNome") }; FiltroObjeto fo = new FiltroObjeto( "empEmpresa", ECompara.IGUAL, new EmpEmpresa(Ponte.getLogin().getEmpresaId())); CoreProxy<FinConta> proxy = new CoreProxy<FinConta>(new FinConta(), fo); final Store storeConta = new Store(proxy, new ArrayReader(new RecordDef(fdConta)), true); storeConta.addStoreListener( new StoreListenerAdapter() { public void onLoad(Store store, Record[] records) { mostrar(); getTopToolbar().addSeparator(); getTopToolbar().addButton(btnArquivo); } public void onLoadException(Throwable error) { MessageBox.confirm( OpenSigCore.i18n.txtEmbalagem(), OpenSigCore.i18n.msgRecarregar(), new ConfirmCallback() { public void execute(String btnID) { if (btnID.equalsIgnoreCase("yes")) { storeConta.load(); } } }); } }); cmbConta = new ComboBox(OpenSigCore.i18n.txtConta(), "finConta.finContaId", 200); cmbConta.setAllowBlank(false); cmbConta.setStore(storeConta); cmbConta.setListWidth(200); cmbConta.setTriggerAction(ComboBox.ALL); cmbConta.setMode(ComboBox.LOCAL); cmbConta.setDisplayField("finContaNome"); cmbConta.setValueField("finContaId"); cmbConta.setForceSelection(true); cmbConta.setEditable(false); return cmbConta; }
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; }
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; }