PDA

View Full Version : vtypeText isn't visible



rahma
15 Sep 2009, 8:40 AM
hello guys,
i have a problem, the vtypeText isn't displayed i don't know why this is my code :
(in the picture as you can see the error message isn't visible (only the red picture is shown) and in the last textfield, only borders are red, there is no error message and no error picture)
the vtypes are declared in an other javascript file as follow:


Ext.apply(Ext.form.VTypes, {
vtypePrud2:function(v){
return (...);
},
vtypePrud3:function(v){
return (...);
},
vtypePrud4:function(v){
return (...);
},
vtypePrud1_2:function(v){
return (...);
},
vtypePrud1_3:function(v){
return (...);
},
vtypePrud1_4:function(v){
return (...);
},
vtypePrud2_2:function(v){
return (...);
},
vtypePrud2_3:function(v){
return (...);
},
vtypePrud2_4:function(v){
return (...);
},
vtypePrud3_2:function(v){
return (...);
},
...
vtypePrud2Text:"la valeur doit être ... !",
vtypePrud3Text:"la valeur doit être ... !",
vtypePrud1_2Text:"la valeur ne doit être ... !",
vtypePrud1_3Text:"la valeur ne doit être ... !",
...
});



function _MAJTablePrudence(){
if(!MAJTablePrudence)
{
FrequencePanel= new Ext.Panel({
layout: 'form',
items: [
{
layout:'column',
border:false,
items:[
{
layout: 'form',
border:false,
items: [
{
xtype:'label',
text:'Trés prudt',
cls: 'x-form-item label_style',
style:'margin-left:210px'
}
]
},
{
layout: 'form',
border:false,
items: [
{
xtype:'label',
text:'Prudent',
cls: 'x-form-item label_style',
style:'margin-left:50px'
}
]
},
{
layout: 'form',
border:false,
items: [
{
xtype:'label',
text:'Normal',
cls: 'x-form-item label_style',
style:'margin-left:50px'
}
]
},
{
layout: 'form',
border:false,
items: [
{
xtype:'label',
text:'st.Mini',
cls: 'x-form-item label_style',
style:'margin-left:50px'
}
]
}
]
},
{
layout:'column',
border:false,
items:[
{
layout: 'form',
border:false,
items: [
{
xtype:'label',
text:'fréquence des sorties',
cls: 'x-form-item label_style',
style:'margin-left:20px',
width:140
}
]
}
]
}
,{
layout:'column',
border:false,
items:[
{
layout: 'form',
border:false,
items: [
{
id:'label_rares',
xtype:'label',
text:'rares',
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-left:20px',
width:50
}
]
},
{
layout: 'form',
border:false,
labelAlign:'right',
items: [
{
id:'rares',
xtype:'label',
text:'rares(Hp/i<',
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-left:10px',
width:100
}
]
},
{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
bodyStyle:'padding 0px 0px 0px 0px',
items: [
{
xtype:'textfield',
id:'kp_t1',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_p1',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud1_2',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_n1',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_m1',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud1_4',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
]
}
,{
layout:'column',
border:false,
items:[

{
layout: 'form',
border:false,
items: [
{
id:'label_assezRares',
xtype:'label',
text:'assez rares ',
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-bottom:10px;margin-left:20px',
width:70
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
items: [
{
id:'assezRares',
xtype:'label',
text:'assez rares (',
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-bottom:10px;margin-left:10px',
width:80
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_t2',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_p2',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud2_2',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);

}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_n2',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud2_3',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
validator:function(){
return (FrequencePanel.findById('kp_n2').getValue() <= FrequencePanel.findById('kp_p2').getValue());
},
listeners: {
change :function(field,nv,ov){
Ext.getCmp('kp_n2').setValue((parseFloat(nv)).toFixed(2));

},
render: function(c) {
c.on('blur',function() {
if (!c.validate())
{
ShowAlert ('entrer une valeur 0<=x<='+ FrequencePanel.findById('kp_p2').getValue());
c.setValue('0');
}
}
);
},
scope: this
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_m2',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud2_4',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
validator:function(){
return (FrequencePanel.findById('kp_m2').getValue() <= FrequencePanel.findById('kp_n2').getValue());
},
listeners: {
change :function(field,nv,ov){
Ext.getCmp('kp_m2').setValue((parseFloat(nv)).toFixed(2));

},
render: function(c) {
c.on('blur',function() {
if (!c.validate())
{
ShowAlert ('entrer une valeur 0<=x<='+ FrequencePanel.findById('kp_n2').getValue());
c.setValue('0');
}
}
);
},
scope: this
}
}
]
}
]
}
,{
layout:'column',
border:false,
items:[
{
layout: 'form',
border:false,
items: [
{
id:'label_assezFreq',
xtype:'label',
text:'assez fréq',
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-bottom:10px;margin-left:20px;margin-top:0px',
width:50
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
items: [
{
id:'assezFreq',
xtype:'label',
text:'assez fréq (',
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-bottom:10px;margin-left:10px;',
width:100
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_t3',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_p3',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud3_2',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_n3',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud3_3',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_m3',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud3_4',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
]
}
,{
layout:'column',
border:false,
items:[

{
layout: 'form',
border:false,
items: [
{
id:'label_freq',
xtype:'label',
text:'fréquentes' ,
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-left:20px',
width:60
}
]
},
{
layout: 'form',
border:false,
labelAlign:'right',
items: [
{
id:'freq',
xtype:'label',
text:'fréquentes (Hp/i>' ,
cls: 'x-form-item label_style',
style:'margin-top:5px;margin-left:10px',
width:90
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_t4',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_p4',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud4_2',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_n4',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud4_3',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
,{
layout: 'form',
border:false,
labelAlign:'right',
labelWidth:40,
items: [
{
xtype:'textfield',
id:'kp_m4',
cls: 'x-form-item label_style',
style:'margin-bottom:10px;text-align:right;',
height:18,
width:40,
vtype:'vtypePrud4_4',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
}
]
}
]
}
]
});
var P_MAJTablePrudence = new Ext.Panel({
layout:'form',
defaultType:'textfield',
frame:true,
buttonAlign:'center',
items: [
{ //ce panneau permet de decaler le contenu du panneau vers le bas
xtype:'panel',
height:20,
width:50
},
{
xtype:'label',
text:'MISE A JOUR DE LA TABLE DE PRUDENCE',
style:'margin-left:3.5cm;margin-bottom:20px'
},
{
xtype:'panel',
height:20,
width:100
},
{
xtype:'textfield',
labelAlign:'left',
id:'lim1_dsuri',
fieldLabel:'limite ligne 1 / ligne 2',
cls: 'x-form-item label_style',
labelStyle:'left:120px;width:330',
style:'text-align:right;',
height:18,
width:40,
vtype:'nonNul',
enableKeyEvents:true,
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99',false)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
},
{ xtype:'textfield',
labelAlign:'left',
id:'lim2_dsuri',
fieldLabel:'limite ligne 2 / ligne 3',
cls: 'x-form-item label_style',
labelStyle:'left:120px;width:330',
style:'text-align:right;',
height:18,
width:40,
vtype:'vtypePrud2',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
}
}
},
{ xtype:'textfield',
labelAlign:'left',
id:'lim3_dsuri',
fieldLabel:'limite ligne 3 / ligne 4',
cls: 'x-form-item label_style',
labelStyle:'left:120px;width:330',
height:18,
width:40,
style:'margin-bottom:10px;text-align:right;',
vtype:'vtypePrud3',
plugins: [new Ext.ux.InputTextMask('99'+newDecSep+'99', true)],
listeners: {
change :function(field,nv,ov){
nv = FitValueField(nv).toFixed(2);
nv=nv.replace('.',newDecSep);
field.setValue(nv);
}
}
},
FrequencePanel
,
{
xtype:'panel',
height:27,
width:100
}
],
buttons:[
{
text:'ok',
handler:OnBtnValiderClick
},
{
text:'annuler',
handler:OnBtnAnnulerClick
}
]
});
MAJTablePrudence = new Ext.Window({
title: 'PARAMETRAGE DE GALION',
border: false,
width: 550,
x:300,
y:100,
closable: true,
autoHeight: true,
resizable: false,
modal: true,
draggable: true,
buttonAlign: 'center',
items: [P_MAJTablePrudence],
keys: [
{
key: [Ext.EventObject.ESC],
fn: function(e) {
if(e==Ext.EventObject.ESC){
OnESCKeyClick();
}
},
scope: this
}
]
});
}
MAJTablePrudence.show();
}

Arno.Nyhm
16 Sep 2009, 5:31 AM
you are landed in the gxt category - maybe a admin can switch your thread to the extJS part.

rahma
16 Sep 2009, 6:14 AM
ah ok
sorry, thanks Arno.Nyhm