PDA

View Full Version : on resize window shadow is not resized



Arno.Nyhm
11 Nov 2009, 6:45 AM
if i have a fieldset which is resizable (i think with other resizable items is the same problem) then i get a not syncronized shadow.

it resize the schadow if i use doLayout or sync with the parent window.

but: as noted here this should be fixed already!?
http://www.extjs.com/forum/showthread.php?p=335584#post335584





package com.mycompany.myapplication.client.customer.test;

import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldSetEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;

/**
*
* @author arno.nyhm
*/
public class LayoutClass4 extends Window {

public LayoutClass4() {
createWindow();
}

private void createWindow() {
setWidth(1000);
setAutoHeight(true);
setTitle("ABC");
setModal(true);

setLayout(new FitLayout());

ContentPanel contentPanel = new ContentPanel();
contentPanel.setBodyStyle("padding: 5px 5px 5px 5px;");

contentPanel.setAutoHeight(true);
contentPanel.setHeaderVisible(false);
contentPanel.setLayout(new FormLayout());
contentPanel.add(new FieldSet() {

{
setHeading("Mein FieldSet");
setCollapsible(true);
setLayout(new FormLayout(LabelAlign.TOP));
add(new TextField() {

{
setFieldLabel("abc3");
setEmptyText("kein Text");
setAllowBlank(false);
}
});
addListener(Events.Resize, new Listener<FieldSetEvent>() {

public void handleEvent(FieldSetEvent be) {
// if i add only one! this line, then it removes the shadow! (doLayout OR! sync)
// LayoutClass4.this.doLayout(true);
// LayoutClass4.this.sync(true);
}
});
}
});
contentPanel.add(new TextField() {

{
setFieldLabel("abc3");
setEmptyText("kein Text");
setAllowBlank(false);
}
});
add(contentPanel);
}
}

sven
11 Nov 2009, 6:51 AM
The issue is in your code. Please use the forum serach before posting bugs. Moving this thread to the help forum.

Arno.Nyhm
11 Nov 2009, 7:01 AM
if you give me a hint where the issue in my code is!?

sven
11 Nov 2009, 7:02 AM
You are using autoheight. This means there cannot be ANY automatic resizing of any children. You need to sync the shadow again.

I suggest to always use the help forum before posting in the bug forum.

Arno.Nyhm
11 Nov 2009, 7:14 AM
You are using autoheight. This means there cannot be ANY automatic resizing of any children. You need to sync the shadow again.

but autoheight suggest me, that any resizing is done automaticly.
and it do the resizing.


ok. an other try without autoheight and more simple:




package com.mycompany.myapplication.client.customer.test;

import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldSetEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.form.FieldSet;

/**
*
* @author arno.nyhm
*/
public class LayoutClass4 extends Window {

public LayoutClass4() {
createWindow();
}

private void createWindow() {
setWidth(300);
setHeading("ABC");

ContentPanel contentPanel = new ContentPanel();

contentPanel.setHeaderVisible(false);
contentPanel.add(new FieldSet() {

{
setHeading("Mein FieldSet");
setCollapsible(true);
add(new HtmlContainer("test"));
add(new HtmlContainer("test"));
add(new HtmlContainer("test"));
}
});
add(contentPanel);
}
}

Arno.Nyhm
11 Nov 2009, 7:15 AM
I suggest to always use the help forum before posting in the bug forum.


i have done this and find your:

http://www.extjs.com/forum/showthread.php?p=335584#post335584

That works too, but you should call for


panel.sync(true);The next release is doing that automatically


and now it not doing this automatically ;-)

sven
11 Nov 2009, 7:15 AM
AutoHeight means autoheight of the browser. This maens no events, no children resizing.

So you actually should never ever use it.

Arno.Nyhm
11 Nov 2009, 7:18 AM
AutoHeight means autoheight of the browser. This maens no events, no children resizing.

So you actually should never ever use it.

thats completely different to the api docs:



setAutoHeight

public void setAutoHeight(boolean autoHeight) Sets the component's auto height value (defaults to false).
Parameters:autoHeight - true to enable auto height
Ref: http://www.extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/widget/BoxComponent.html#setAutoHeight%28boolean%29

sven
11 Nov 2009, 7:21 AM
The component grows automatically. The shadow is not part of the component. It is another component.

There is no need to discuss this again as it was discussed in atleast 2 different threads.

Arno.Nyhm
11 Nov 2009, 7:27 AM
sorry. but this is not logical for me. and if this discussions comes over and over again, then for others it is also not logical and looks like a bug.

the shadow is part of the window component.

if the window component changes the size (for example because of collapsing the fieldset) then also the shadow should resizing!

sven
11 Nov 2009, 7:30 AM
It cannot be auto sized. There is NO event on resizing when using autoehight.

This is basic understandig of how browser sizing works. We cannot change this and we cannot work around this because we never know when any element may changes it size.

That is way you never should use autoheight.

Also i never have seen any application where application windows change its height when i expand/collapse something.

Arno.Nyhm
11 Nov 2009, 7:46 AM
It cannot be auto sized. There is NO event on resizing when using autoehight.

This is basic understandig of how browser sizing works. We cannot change this and we cannot work around this because we never know when any element may changes it size.

That is way you never should use autoheight.

Also i never have seen any application where application windows change its height when i expand/collapse something.

it is possible to do this. and it looks better as when we have a blank space it some elements are collapsed.

and yes i see this here:
http://www.extjs.com/examples/explorer.html#forms

click on the fieldset checkbox. then also the formpanel resizes. why this should not done with a (GXT-) Window



did you look on my second example in posting #5 (maybe you miss this between the posts) whithout autoheight?

http://www.extjs.com/forum/showthread.php?p=407599#post407599

Arno.Nyhm
11 Nov 2009, 7:51 AM
This is basic understandig of how browser sizing works. We cannot change this and we cannot work around this because we never know when any element may changes it size.

i dont ask for changing the browser sizing, but only for changing the shadow of a GXT-Window to the same size like the GXT-window.

if the gxt-window changes the height, then the shadow should also follow this. and this looks like a bug here!?

Arno.Nyhm
11 Nov 2009, 7:53 AM
That is way you never should use autoheight.

i dont know why my postings goes to moderation!? so i repeat it shorter:
did you look at my example in my posting #5 without auto heigt?

sven
11 Nov 2009, 7:59 AM
i dont ask for changing the browser sizing, but only for changing the shadow of a GXT-Window to the same size like the GXT-window.

if the gxt-window changes the height, then the shadow should also follow this. and this looks like a bug here!?

It is not a bug. There are no events when something changes the height by autoheight. This means you are the only one that knows it, so you are the only one that can change the shadow again. This was discussed so often now, that i suggest to use the forum search.

Arno.Nyhm
12 Nov 2009, 12:30 AM
ok. but in the next example i do not use autoheight.
please explain why then it is not possible (the fieldset fires the Event.Resize)?


(from posting #5)
ok. an other try without autoheight and more simple:




package com.mycompany.myapplication.client.customer.test;

import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldSetEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.form.FieldSet;

/**
*
* @author arno.nyhm
*/
public class LayoutClass4 extends Window {

public LayoutClass4() {
createWindow();
}

private void createWindow() {
setWidth(300);
setHeading("ABC");

ContentPanel contentPanel = new ContentPanel();

contentPanel.setHeaderVisible(false);
contentPanel.add(new FieldSet() {

{
setHeading("Mein FieldSet");
setCollapsible(true);
add(new HtmlContainer("test"));
add(new HtmlContainer("test"));
add(new HtmlContainer("test"));
}
});
add(contentPanel);
}
}

sven
12 Nov 2009, 3:41 AM
Not setting a height means for the browsers to use auto growing. There is no way to stop this from happening. Please read what i said and use the forum search.