ajuste para aceitar até 3 números e correção para salvar bug#8336
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@63712 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c69c58e9a7
commit
43811974a4
|
@ -6,6 +6,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
@ -183,12 +184,10 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
|||
private Combobox cmbTipoIdentificacion2;
|
||||
|
||||
public void aplicarMascara() {
|
||||
//TODO: Tem que ver uma forma de aplicar a mascara para valores já existentes e que não seguem o padrão de formatação da mascara.
|
||||
//Para esse valores ao aplicar a mascara ele limpa e deixa o campo vazio.
|
||||
// Clients.evalJavaScript(
|
||||
// "jQuery('#" + txtNumFax.getUuid() + "').mask('(999)9999-9999?9');jQuery('#"
|
||||
// + numtelefonodos.getUuid() + "').mask('(999)9999-9999?9');jQuery('#"
|
||||
// + numtelefonouno.getUuid() + "').mask('(999)9999-9999?9')");
|
||||
Clients.evalJavaScript(
|
||||
"jQuery('#" + txtNumFax.getUuid() + "').mask('(99?9)9999-99999');jQuery('#"
|
||||
+ numtelefonodos.getUuid() + "').mask('(99?9)9999-99999');jQuery('#"
|
||||
+ numtelefonouno.getUuid() + "').mask('(99?9)9999-99999')");
|
||||
}
|
||||
|
||||
private void desabilitarComponentes(Boolean desabilitar) {
|
||||
|
@ -773,6 +772,19 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(this.replaceTextbox(txtNumFax))) {
|
||||
cliente.setNumfax(txtNumFax.getValue().replace("_", ""));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(this.replaceTextbox(numtelefonouno))) {
|
||||
cliente.setNumtelefono(numtelefonouno.getValue().replace("_", ""));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(this.replaceTextbox(numtelefonodos))) {
|
||||
cliente.setNumtelefonodos(numtelefonodos.getValue().replace("_", ""));
|
||||
|
||||
}
|
||||
|
||||
setClienteDireccion();
|
||||
cliente.setLsClienteDescuento(lsClienteDescuento);
|
||||
|
@ -809,39 +821,15 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
|||
clienteList.updateItem(cliente);
|
||||
}
|
||||
|
||||
String getString = null;
|
||||
if (!txtNumFax.getValue().equals("")) {
|
||||
getString = this.replaceTextbox(txtNumFax);
|
||||
if (getString.length() >= 11) {
|
||||
cliente.setNumfax(txtNumFax.getValue().replace("_", ""));
|
||||
}
|
||||
}
|
||||
|
||||
if (!numtelefonouno.getValue().equals("")) {
|
||||
getString = this.replaceTextbox(numtelefonouno);
|
||||
if (getString.length() >= 11) {
|
||||
cliente.setNumtelefono(numtelefonouno.getValue().replace("_", ""));
|
||||
}
|
||||
}
|
||||
|
||||
if (!numtelefonodos.getValue().equals("")) {
|
||||
getString = this.replaceTextbox(numtelefonodos);
|
||||
if (getString.length() >= 11) {
|
||||
cliente.setNumtelefonodos(numtelefonodos.getValue().replace("_", ""));
|
||||
}
|
||||
}
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarClienteController.MSG.suscribirOK"),
|
||||
Labels.getLabel("editarClienteController.window.title"), Messagebox.OK,
|
||||
Messagebox.INFORMATION);
|
||||
|
||||
closeWindow();
|
||||
} catch (WrongValueException ex) {
|
||||
log.error("editarClienteController: " + ex);
|
||||
Messagebox.show(Labels.getLabel("MSG.Error.ClienteAbaEstudante"),
|
||||
Labels.getLabel("editarClienteController.window.title"), Messagebox.OK,
|
||||
Messagebox.ERROR);
|
||||
throw ex;
|
||||
} catch (Exception ex) {
|
||||
|
||||
log.error("editarClienteController: " + ex);
|
||||
Messagebox.show(Labels.getLabel("MSG.Error"),
|
||||
Labels.getLabel("editarClienteController.window.title"), Messagebox.OK,
|
||||
|
|
Loading…
Reference in New Issue