PDA

View Full Version : [CLOSED] Differences between Hosted mode and Web Mode



zaccret
19 May 2008, 6:22 AM
Hi,

Sometimes, I have differences between web mode and hosted mode. Well I feel it looks like a GWT bug, but GXT code will probably not help GWT team. What can I do ? Here is the code :


public void onModuleLoad(){
Viewport viewport = new Viewport();
viewport.setLayout(new BorderLayout());

BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.margins = new Margins(0, 0, 5, 0);
ContentPanel mainPanel = new ContentPanel();

BorderLayoutData mainCenter = new BorderLayoutData(Style.LayoutRegion.CENTER);
mainCenter.margins = new Margins(0, 5, 5, 5);
viewport.add(mainPanel, mainCenter);

ToolBar topPanel = new ToolBar();

final Menu menu1 = new Menu();
menu1.add(new Item("This is a long long item text"));
menu1.add(new Item("Show all files"));
TextToolItem tool1 = new TextToolItem("File");
tool1.setMenu(menu1);
topPanel.add(tool1);

BorderLayoutData northData = new BorderLayoutData(Style.LayoutRegion.NORTH,15);
viewport.add(topPanel, northData);

ContentPanel west = new ContentPanel();
west.setHeading("My application");

BorderLayoutData westData = new BorderLayoutData(Style.LayoutRegion.WEST, 200, 150, 350);
viewport.add(west, westData);

RootPanel.get().add(viewport);
}The differences :
- the toolbar height : good looking in hosted mode, but I think more than 15 pixel height. 15 pixel height in web mode. As a workaround, I can set 25 pixel height and it's ok for both.
- the menu width : ok in hosted mode, not ok in web mode (text overflow)
- the margins

I have also noticed some differences in these threads :
http://extjs.com/forum/showthread.php?t=35695
http://extjs.com/forum/showthread.php?t=35575

darrellmeyer
20 May 2008, 8:26 PM
You code was a little off. Try this code with beta 3. It works in both web and host mode.


public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new BorderLayout());

ContentPanel mainPanel = new ContentPanel();

BorderLayoutData mainCenter = new BorderLayoutData(Style.LayoutRegion.CENTER);
mainCenter.setMargins(new Margins(0, 5, 5, 5));
viewport.add(mainPanel, mainCenter);

ToolBar topPanel = new ToolBar();

final Menu menu1 = new Menu();
menu1.add(new Item("This is a long long item text"));
menu1.add(new Item("Show all files"));
TextToolItem tool1 = new TextToolItem("File");
tool1.setMenu(menu1);
topPanel.add(tool1);

BorderLayoutData northData = new BorderLayoutData(Style.LayoutRegion.NORTH, 30);
northData.setMargins(new Margins(5));
viewport.add(topPanel, northData);

ContentPanel west = new ContentPanel();
west.setHeading("My application");

BorderLayoutData westData = new BorderLayoutData(Style.LayoutRegion.WEST, 200, 150, 350);
westData.setMargins(new Margins(0, 0, 5, 5));
viewport.add(west, westData);

RootPanel.get().add(viewport);
}

I am closing the bug, if you still have problems you can reply to this post.

zaccret
21 May 2008, 12:34 AM
Hi Darell. Great! It works and, most importantly, we have the same behaviour in hosted mode and web mode, at least with IE6 (the behaviour is slightly different in Firefox 3 beta 5).

Thanks again for your work, I really think you are making a great product. By the way, we are about to purchase a licence + support ;)

zaccret
21 May 2008, 4:05 AM
Actually, I work on Windows so my hosted mode is using IE core. The differences are not really between web and hosted mode but between IE6 and Firefox (FF2 and FF3).

zaccret
23 May 2008, 1:06 AM
I've postponed the remaining margins/height issue in a new thread : http://extjs.com/forum/showthread.php?p=172228