PDA

View Full Version : integrate a dynamic url Ext.Window in desktop



nunziofiore
1 Feb 2008, 2:33 PM
Hi all,
I made a big application desktop using some mootools and an old web os framework called x.desktop. in these days i decided to translate my app from x-desktop to Ext.js .
I made a useful function to open Ext.Window with a dynamic url from my java server side.... Now I have a problem, cause I integrated my app in a ext.js desktop environment like desktop2.0 in ext's examples. And with that function i can open different windows, but i can't make interact my Ext.Window with taskbar, cause it's not a window of desktop created with createWindow function... so I had windows with miminze button but that can't go to taskbar...
or that can't interact with desktop's layout.

here my functio code:


var openWindow = function(t,urlTxt,opt){
var w = 400; if (opt.w) w=opt.w;
var h = 200; if (opt.h) h=opt.h;
var minW=100; if (opt.minW) minW=opt.minW;
var minH=100; if (opt.minH) minH=opt.minH;
var mod=false; if (opt.mod) mod=opt.mod;
var res=true; if (opt.res) res=opt.res;
var drag=true; if (opt.drag) drag=opt.drag;
var max=false; if (opt.max) max=opt.max;
var coll=false; if (opt.coll) coll=opt.coll;
var clos=true; if (opt.clos) clos=opt.clos;
var autoS=false; if (opt.autoS) autoS=opt.autoS;
var desc=t; if (opt.desc) desc=opt.desc;
var win =new Ext.Window({
title:desc,
width:w,
height:h,
minWidth:minW,
minHeight:minH,
modal:mod,
resizable:res,
draggable:drag,
maximizable:max,
collapsible:coll,
closable:clos,
autoScroll:autoS,
html:'',
autoLoad: {url:urlTxt,scripts:true},
animateTarget:"",
bodyStyle:"padding:5px",
iconCls:"",
minimizable: true,
});

return win;

}

can somebody help me?
bye and sorry for my terrible english
nunziofiore

Condor
2 Feb 2008, 2:18 AM
Why not use MyDesktop.getDesktop().createWindow instead of new Ext.Window ?

nunziofiore
3 Feb 2008, 6:52 AM
Thank you Condor for the answer. I tried createWindow now (do you want the real reason cause i didn't try before? :) cause i didn't understand how to retrieve the desktop object... i made a mistake and I believed that MyDesktop it was an istance of desktop itself and when i user MyDesktop.createWindow I had some errors...)... Now, I ask you another help if you can... because to use MyDesktop.getDesktop().createWindow it run equals of my function but it seems that windows can't be minimized and interact with the taskbar....

what's the error in



var openWindow = function(t,urlTxt,opt){
var w = 400; if (opt.w) w=opt.w;
var h = 200; if (opt.h) h=opt.h;
var minW=100; if (opt.minW) minW=opt.minW;
var minH=100; if (opt.minH) minH=opt.minH;
var mod=false; if (opt.mod) mod=opt.mod;
var res=true; if (opt.res) res=opt.res;
var drag=true; if (opt.drag) drag=opt.drag;
var max=false; if (opt.max) max=opt.max;
var coll=false; if (opt.coll) coll=opt.coll;
var clos=true; if (opt.clos) clos=opt.clos;
var autoS=false; if (opt.autoS) autoS=opt.autoS;
var desc=t; if (opt.desc) desc=opt.desc;
var win = MyDesktop.getDesktop().createWindow({
title:desc,
width:w,
height:h,
minWidth:minW,
minHeight:minH,
modal:mod,
resizable:res,
draggable:drag,
maximizable:max,
collapsible:coll,
closable:clos,
autoScroll:autoS,
html:'',
autoLoad: {url:urlTxt,scripts:true},
animateTarget:"",
bodyStyle:"padding:5px",
iconCls:"",
minimizable: true,
});

return win;

}

nunziofiore
3 Feb 2008, 6:56 AM
ok sorry.. i tried again and it run very well... it was a cache trouble probably (i had a lot of cache trouble with my ext window and widgets, but i think that it's my non experince with that ( i started only foru days ago)... i had only a bug with ie7... but i think i can solve this ... thank you for your help