PDA

View Full Version : [2.0b1] hello, little bug (i think) with ajax request



AlexisG
16 Oct 2007, 6:17 AM
hi all, i've got something strange in my app
its running on IE6 with the Beta of ext 2

here is part of the code

[CODE]var frmAdd = new Ext.form.FormPanel({
id: 'subfrmAdd',
labelWidth: 120,
border : false,
layout: 'fit',
items: new Ext.form.HtmlEditor( {
hideLabel: true,
name: 'objCol',
id: 'objCol'
})
});


//Ext.lib.Ajax.setDefaultPostHeader('text/html; charset=iso-8859-1');

var viewport = new Ext.Viewport({
layout:'border',
items:[
{
region:'west',
id:'west-panel',
title: "Service ou liste des services : ",
split:true,
width: 320,
minSize: 5,
maxSize: 400,
margins:'4 0 1 1',
layout:'fit',
items: tree
},
{
region:'center',
id:'center-panel',
split:true,
width: 200,
minSize: 5,
maxSize: 100,
margins:'4 0 1 1',
layout:'fit',
items : new Ext.Panel({
title: '',
layout:'border',
border : false,
name: 'panel',
items: [{
title: "Formulaire d'ajout d'un 'objectif collectif' : ",
region:'north',
width: 200,
height: 200,
minSize: 80,
maxSize: 300,
layout:'fit',
items : frmAdd,
buttons: [{text:'Sauver', disabled: securityEnabled, handler:function(){
var valueText = Ext.util.Format.htmlDecode(Ext.get('objCol').getValue());
//alert(valueText);
if (rowIsEnabled) {
if (valueText != "") {
grid.body.mask('Loading', 'x-mask-loading');
var con = new Ext.data.Connection();
con.request({
url : './addObjColBySvc.action',
params : { ObjDes: valueText},
method: 'POST',
defaultHeaders: {'Content-Type': 'text/html;charset=ISO-8859-1'},
callback: function(opts, success, response){
if (success) {
loadRecords();
}
}
});
}
else {
Ext.Msg.alert("Information : ", "Le libell

AlexisG
16 Oct 2007, 10:29 PM
Bis

i've tried this input of special chars with the ext alpha1 and ext v1, and in IE6, the first time it always send a special conversion of this chars, the other times it work well. That's like if the connect component wat not well initialized the first time, and after it works...i follow some test again, but that will be a huge problem for me if i can't find a solution. :)

AlexisG
16 Oct 2007, 11:58 PM
bis bis

i've tried someting else

this code on page init

[CODE]var con = new Ext.data.Connection();
function init(){
//alert('init');
con.request({
url : './nothing.action',
method: 'POST',
params : { id: 'b

AlexisG
17 Oct 2007, 1:06 AM
okay, so to bypass this problem we have to make this :



params : { objOrder: order, ObjDes : escape(Ext.get('ObjDesUpd').getValue()) },

and on serverside:


String strOut = URLDecoder.decode(strIn,"ISO-8859-1");

this work on the first problem, have to see if it works on jsp with other encoding

but if it should work whithout this functions it would be better :)

and now ~o)

AlexisG
19 Oct 2007, 12:03 AM
Are we the only one on the world with this problem ? :D

or is there something we doing wrong.