fixes bug#0012678
dev: thiago qua: renato Correção efetuada. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@87214 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c815cf87d4
commit
4c858c5e4c
|
@ -12,7 +12,6 @@ import org.apache.log4j.Logger;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zhtml.Messagebox;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
|
@ -29,7 +28,6 @@ import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
|||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.RegionMetropolitana;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
|
@ -48,6 +46,7 @@ import com.rjconsultores.ventaboletos.service.RutaService;
|
|||
import com.rjconsultores.ventaboletos.service.TarifaMinimaService;
|
||||
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MensagensUtils;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
|
@ -63,6 +62,10 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaMinimaCat
|
|||
@Scope("prototype")
|
||||
public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
||||
|
||||
private static final String MSG_ERROR = "MSG.Error";
|
||||
|
||||
private static final String TITULO_TARIFA_MINIMA = "editarTarifaMinimaController.window.title";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
|
@ -111,7 +114,7 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
private MyComboboxEstandar cmbCategorias;
|
||||
private MyListbox tarifaMinimaCategoriaList;
|
||||
private Combobox cmbVigencia;
|
||||
private Combobox cmbRegionMetropolitana;
|
||||
private MyComboboxEstandar cmbRegionMetropolitana;
|
||||
private Combobox cmbCoeficienteTarifa;
|
||||
private List<VigenciaTarifa> lsVigenciaTarifa;
|
||||
private List<Ruta> lsRuta;
|
||||
|
@ -155,7 +158,6 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public void onChange$cmbClaseServicio(InputEvent ev) {
|
||||
|
||||
if (ev.isChangingBySelectBack()) {
|
||||
return;
|
||||
}
|
||||
|
@ -164,20 +166,19 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public void onChange$cmbRegionMetropolitana(InputEvent ev) {
|
||||
|
||||
if (ev.isChangingBySelectBack()) {
|
||||
return;
|
||||
}
|
||||
|
||||
tarifaMinima.setCoeficienteTarifa(null);
|
||||
cmbCoeficienteTarifa.setSelectedItem(null);
|
||||
tarifaMinima.setOrigem(null);
|
||||
cmbOrigem.setSelectedItem(null);
|
||||
cmbOrigem.setValue("");
|
||||
tarifaMinima.setDestino(null);
|
||||
cmbDestino.setSelectedItem(null);
|
||||
cmbDestino.setValue("");
|
||||
}
|
||||
|
||||
public void onChange$cmbOrigem(InputEvent ev) {
|
||||
|
||||
if (ev.isChangingBySelectBack()) {
|
||||
return;
|
||||
}
|
||||
|
@ -186,7 +187,6 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public void onChange$cmbDestino(InputEvent ev) {
|
||||
|
||||
if (ev.isChangingBySelectBack()) {
|
||||
return;
|
||||
}
|
||||
|
@ -195,25 +195,21 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public void onChange$cmbCoeficienteTarifa(InputEvent ev) {
|
||||
|
||||
if (ev.isChangingBySelectBack()) {
|
||||
return;
|
||||
}
|
||||
|
||||
tarifaMinima.setRegionMetropolitana(null);
|
||||
cmbRegionMetropolitana.setSelectedItem(null);
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||
|
||||
txtImportancia.getValue();
|
||||
cmbMoneda.getValue();
|
||||
cmbPlaza.getValue();
|
||||
cmbMarca.getValue();
|
||||
// cmbOrigem.getValue(true);
|
||||
// cmbDestino.getValue(true);
|
||||
cmbClaseServicio.getValue();
|
||||
cmbOrgaoConcedente.getValue();
|
||||
|
||||
tarifaMinima.setFecmodif(Calendar.getInstance().getTime());
|
||||
tarifaMinima.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
tarifaMinima.setActivo(Boolean.TRUE);
|
||||
|
@ -225,22 +221,6 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
}
|
||||
tarifaMinima.setRuta(ruta);
|
||||
|
||||
Comboitem cbiOrigem = cmbOrigem.getSelectedItem();
|
||||
Parada origem = null;
|
||||
if (cbiOrigem != null) {
|
||||
cmbOrigem.getValue(true);
|
||||
origem = cmbOrigem.getSelectedObject();
|
||||
}
|
||||
tarifaMinima.setOrigem(origem);
|
||||
|
||||
Comboitem cbiDestino = cmbDestino.getSelectedItem();
|
||||
Parada destino = null;
|
||||
if (cbiDestino != null) {
|
||||
cmbDestino.getValue(true);
|
||||
destino = cmbDestino.getSelectedObject();
|
||||
}
|
||||
tarifaMinima.setDestino(destino);
|
||||
|
||||
Comboitem cbiVigenciaTarifa = cmbVigencia.getSelectedItem();
|
||||
VigenciaTarifa vigenciaTarifa = null;
|
||||
if (cbiVigenciaTarifa != null) {
|
||||
|
@ -263,91 +243,66 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
tarifaMinima.setCoeficienteTarifa(coeficienteTarifa);
|
||||
|
||||
try {
|
||||
if (tarifaMinima.getOrgaoConcedente() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.orgao"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}else if (tarifaMinima.getMoneda() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.moneda"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else if (tarifaMinima.getPlaza() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.plaza"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else if (tarifaMinima.getMarca() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.marca"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else if (tarifaMinima.getOrigem() == null && tarifaMinima.getDestino() == null &&
|
||||
tarifaMinima.getRegionMetropolitana() == null) {
|
||||
// } else if (tarifaMinima.getOrigem() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.parada"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
// } else if (tarifaMinima.getDestino() == null) {
|
||||
// Messagebox.show(
|
||||
// Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.destino"),
|
||||
// Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
// Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else if (tarifaMinima.getClaseServicio() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.tipo"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
// } else if (tarifaMinima.getOrigem().getParadaId().equals(tarifaMinima.getDestino().getParadaId())
|
||||
// && (!tarifaMinima.getOrigem().getParadaId().equals(-1) && !tarifaMinima.getDestino().getParadaId().equals(-1))) {
|
||||
// Messagebox.show(
|
||||
// Labels.getLabel("MSG.Origem.Igual.Destino"),
|
||||
// Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
// Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
|
||||
} else {
|
||||
if (isCamposObrigatoriosValidos()) {
|
||||
if (tarifaMinima.getTarifaminimaId() == null) {
|
||||
List<TarifaMinima> lsTM = tarifaMinimaService.pesquisar(tarifaMinima );
|
||||
|
||||
if (lsTM.isEmpty()) {
|
||||
tarifaMinimaService.suscribir(tarifaMinima);
|
||||
tarifaMinimaList.addItem(tarifaMinima);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
||||
closeWindow();
|
||||
salvarNovaTarifa();
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("MSG.Registro.Existe"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
} else {
|
||||
tarifaMinimaService.actualizacion(tarifaMinima);
|
||||
tarifaMinimaList.updateItem(tarifaMinima);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
||||
closeWindow();
|
||||
salvarEdicaoTarifa();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("Editar tarida minimas: " + ex);
|
||||
Messagebox.show(
|
||||
Labels.getLabel("MSG.Error"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
MensagensUtils.showMessageError(MSG_ERROR, TITULO_TARIFA_MINIMA);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isCamposObrigatoriosValidos() {
|
||||
if (tarifaMinima.getOrgaoConcedente() == null) {
|
||||
MensagensUtils.showMessageExclamation("editarTarifaMinimaController.btnFechar.MSG.orgao", TITULO_TARIFA_MINIMA);
|
||||
return false;
|
||||
}
|
||||
if (tarifaMinima.getMoneda() == null) {
|
||||
MensagensUtils.showMessageExclamation("editarTarifaMinimaController.btnFechar.MSG.moneda", TITULO_TARIFA_MINIMA);
|
||||
return false;
|
||||
}
|
||||
if (tarifaMinima.getPlaza() == null) {
|
||||
MensagensUtils.showMessageExclamation("editarTarifaMinimaController.btnFechar.MSG.plaza", TITULO_TARIFA_MINIMA);
|
||||
return false;
|
||||
}
|
||||
if (tarifaMinima.getMarca() == null) {
|
||||
MensagensUtils.showMessageExclamation("editarTarifaMinimaController.btnFechar.MSG.marca", TITULO_TARIFA_MINIMA);
|
||||
return false;
|
||||
}
|
||||
if (tarifaMinima.getOrigem() == null
|
||||
&& tarifaMinima.getDestino() == null
|
||||
&& tarifaMinima.getRegionMetropolitana() == null) {
|
||||
MensagensUtils.showMessageExclamation("editarTarifaMinimaController.btnFechar.MSG.parada", TITULO_TARIFA_MINIMA);
|
||||
return false;
|
||||
}
|
||||
if (tarifaMinima.getClaseServicio() == null) {
|
||||
MensagensUtils.showMessageExclamation("editarTarifaMinimaController.btnFechar.MSG.tipo", TITULO_TARIFA_MINIMA);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void salvarEdicaoTarifa() {
|
||||
tarifaMinimaService.actualizacion(tarifaMinima);
|
||||
tarifaMinimaList.updateItem(tarifaMinima);
|
||||
MensagensUtils.showMessageInformation("editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK", TITULO_TARIFA_MINIMA);
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
private void salvarNovaTarifa() {
|
||||
List<TarifaMinima> listaTarifaMinima = tarifaMinimaService.pesquisar(tarifaMinima);
|
||||
if (listaTarifaMinima.isEmpty()) {
|
||||
tarifaMinimaService.suscribir(tarifaMinima);
|
||||
tarifaMinimaList.addItem(tarifaMinima);
|
||||
MensagensUtils.showMessageInformation("editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK", TITULO_TARIFA_MINIMA);
|
||||
closeWindow();
|
||||
} else {
|
||||
MensagensUtils.showMessageExclamation("MSG.Registro.Existe", TITULO_TARIFA_MINIMA);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnApagar(Event ev) {
|
||||
|
@ -356,20 +311,12 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
tarifaMinima.setActivo(Boolean.FALSE);
|
||||
|
||||
try {
|
||||
int opcao = Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.Deseja.Borrar"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
int opcao = MensagensUtils.showMessageQuestion("editarTarifaMinimaController.btnFechar.MSG.Deseja.Borrar", TITULO_TARIFA_MINIMA);
|
||||
|
||||
if (opcao == Messagebox.YES) {
|
||||
tarifaMinimaService.borrar(tarifaMinima);
|
||||
tarifaMinimaList.removeItem(tarifaMinima);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.borrarOK"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
||||
MensagensUtils.showMessageInformation("editarTarifaMinimaController.btnFechar.MSG.borrarOK", TITULO_TARIFA_MINIMA);
|
||||
closeWindow();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
@ -383,7 +330,6 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
Categoria categoria = (Categoria) cmbCategorias.getSelectedItem().getValue();
|
||||
|
||||
if(categoria != null) {
|
||||
|
||||
TarifaMinimaCategoria tarifaMinimaCategoria = new TarifaMinimaCategoria();
|
||||
tarifaMinimaCategoria.setCategoria(categoria);
|
||||
tarifaMinimaCategoria.setTarifaMinima(tarifaMinima);
|
||||
|
@ -392,44 +338,32 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
|
||||
tarifaMinimaCategoriaList.updateItem(tarifaMinimaCategoria);
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarTarifaMinimaController.msg.adicionarTarifaMinimaCategoria"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK,Messagebox.INFORMATION);
|
||||
|
||||
MensagensUtils.showMessageInformation("editarTarifaMinimaController.msg.adicionarTarifaMinimaCategoria", TITULO_TARIFA_MINIMA);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
Messagebox.show(Labels.getLabel("MSG.Error"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK,Messagebox.ERROR);
|
||||
MensagensUtils.showMessageError(MSG_ERROR, TITULO_TARIFA_MINIMA);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnRemoverCategoria(Event ev) throws InterruptedException {
|
||||
try {
|
||||
if(tarifaMinimaCategoriaList.getSelected() != null) {
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.msg.removerTarifaMinimaCategoriaPergunta"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
int resp = MensagensUtils.showMessageQuestion("editarTarifaMinimaController.msg.removerTarifaMinimaCategoriaPergunta", TITULO_TARIFA_MINIMA);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
TarifaMinimaCategoria tarifaMinimaCategoria = (TarifaMinimaCategoria) tarifaMinimaCategoriaList.getSelected();
|
||||
tarifaMinimaService.removerTarifaMinimaCategoria(tarifaMinimaCategoria);
|
||||
tarifaMinimaCategoriaList.removeItem(tarifaMinimaCategoria);
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarTarifaMinimaController.msg.removerTarifaMinimaCategoria"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK,Messagebox.INFORMATION);
|
||||
MensagensUtils.showMessageInformation("editarTarifaMinimaController.msg.removerTarifaMinimaCategoria", TITULO_TARIFA_MINIMA);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
Messagebox.show(Labels.getLabel("MSG.Error"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK,Messagebox.ERROR);
|
||||
MensagensUtils.showMessageError(MSG_ERROR, TITULO_TARIFA_MINIMA);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -647,7 +581,7 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
return cmbRegionMetropolitana;
|
||||
}
|
||||
|
||||
public void setCmbRegionMetropolitana(Combobox cmbRegionMetropolitana) {
|
||||
public void setCmbRegionMetropolitana(MyComboboxEstandar cmbRegionMetropolitana) {
|
||||
this.cmbRegionMetropolitana = cmbRegionMetropolitana;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias;
|
||||
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
|
||||
public class EventListenerOnCtrlKeyMyComboBoxEstandar implements EventListener {
|
||||
|
||||
private MyComboboxEstandar comboBoxEstandar;
|
||||
|
||||
public EventListenerOnCtrlKeyMyComboBoxEstandar(MyComboboxEstandar comboBoxEstandar) {
|
||||
this.comboBoxEstandar = comboBoxEstandar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
comboBoxEstandar.setSelectedItem(null);
|
||||
comboBoxEstandar.close();
|
||||
}
|
||||
|
||||
}
|
|
@ -8,26 +8,33 @@ public class MensagensUtils {
|
|||
private MensagensUtils() {
|
||||
}
|
||||
|
||||
public static void showMessageInformation(String labelMensagem, String tituloMenssagem) {
|
||||
showMessage(labelMensagem, tituloMenssagem, Messagebox.INFORMATION);
|
||||
public static int showMessageInformation(String labelMensagem, String tituloMenssagem) {
|
||||
return showMessage(labelMensagem, tituloMenssagem, Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
|
||||
public static void showMessageExclamation(String labelMensagem, String tituloMenssagem) {
|
||||
showMessage(labelMensagem, tituloMenssagem, Messagebox.EXCLAMATION);
|
||||
public static int showMessageExclamation(String labelMensagem, String tituloMenssagem) {
|
||||
return showMessage(labelMensagem, tituloMenssagem, Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
|
||||
public static void showMessageError(String labelMensagem, String tituloMenssagem) {
|
||||
showMessage(labelMensagem, tituloMenssagem, Messagebox.ERROR);
|
||||
public static int showMessageError(String labelMensagem, String tituloMenssagem) {
|
||||
return showMessage(labelMensagem, tituloMenssagem, Messagebox.OK, Messagebox.ERROR);
|
||||
}
|
||||
|
||||
private static void showMessage(String labelMensagem, String tituloMenssagem, String tipoMenssagem) {
|
||||
public static int showMessageQuestion(String labelMensagem, String tituloMenssagem) {
|
||||
return showMessage(labelMensagem, tituloMenssagem, Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
}
|
||||
|
||||
private static int showMessage(String labelMensagem, String tituloMenssagem,
|
||||
int botoesMensagem, String iconeMensagem) {
|
||||
try {
|
||||
Messagebox.show(
|
||||
return Messagebox.show(
|
||||
Labels.getLabel(labelMensagem),
|
||||
Labels.getLabel(tituloMenssagem),
|
||||
Messagebox.OK, tipoMenssagem);
|
||||
botoesMensagem, iconeMensagem);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
return Messagebox.OK;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias;
|
||||
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Combobox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.TypeEventListener;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author gleimar
|
||||
|
@ -24,7 +24,7 @@ public class MyComboboxEstandar extends Combobox {
|
|||
this.setReadonly(true);
|
||||
this.setCtrlKeys("#del");
|
||||
|
||||
this.addEventListener("onCtrlKey", new EventListenerOnCtrlKey());
|
||||
this.addEventListener(TypeEventListener.ON_CTRL_KEY.getEvent(), new EventListenerOnCtrlKeyMyComboBoxEstandar(this));
|
||||
}
|
||||
|
||||
public <T> T getSelecteObject(Class<T> cType) {
|
||||
|
@ -34,12 +34,4 @@ public class MyComboboxEstandar extends Combobox {
|
|||
return null;
|
||||
}
|
||||
|
||||
private final class EventListenerOnCtrlKey implements EventListener {
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
MyComboboxEstandar.this.setSelectedItem(null);
|
||||
MyComboboxEstandar.this.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue