PDA

View Full Version : CenterLayout and Explorer inestability



fjulbe
24 Oct 2008, 5:56 AM
I'm not sure if there is already some open issues about this. But when using CenterLayout, I have quite irregular behaviour with iexplorer. The error (or inestability to be more precise) appears randomly which make it more annoying.

I have this piece of code:

public class MainEntryPoint extends LayoutContainer implements EntryPoint {

/** Creates a new instance of MainEntryPoint */
public MainEntryPoint() {
}

public void onModuleLoad() {
ContentPanel panel = new ContentPanel();
ContentPanel sub_panel=new ContentPanel();
panel.setLayout(new CenterLayout());
sub_panel.setHeight(250);
sub_panel.setHeading("Sub panel");
InfoPanel info = new InfoPanel();
sub_panel.add(info);
panel.add(sub_panel);
panel.setFrame(true);
panel.setHeading("MainPanel Frame");
setLayout(new FlowLayout());
add(panel);
RootPanel.get().add(this);
}

}

Which uses:

InfoPanel.java

public class InfoPanel extends LayoutContainer{

private TextField text1;
private ComboBox combo1;
private FieldSet fieldSet;


public InfoPanel()
{
setLayout(new FlowLayout(10));
LayoutContainer main = new LayoutContainer();
main.setWidth(250);
main.setAutoHeight(true);
main.setLayout(new ColumnLayout());

LayoutContainer left = new LayoutContainer();

FormLayout layout = new FormLayout();
layout.setLabelAlign(LabelAlign.TOP);
left.setLayout(layout);

text1 = new TextField();
text1.setFieldLabel("Text 1");
text1.setData("anchorSpec", "-20");

ListStore store = new ListStore();
List<OptionPair> choice = new ArrayList();
choice.add(new OptionPair("Option 1",1));
choice.add(new OptionPair("Option 2",2));
store.add(choice);

combo1 = new ComboBox();
combo1.setFieldLabel("Combo Options");
combo1.setDisplayField("name_case");
combo1.setStore(store);
combo1.setForceSelection(true);
combo1.setEditable(false);
combo1.setValue(store.getAt(0));

left.add(text1);
left.add(combo1);

main.add(left, new ColumnData(.99));
fieldSet = new FieldSet();
fieldSet.setHeading("Field set");
fieldSet.setCheckboxToggle(false);
fieldSet.setWidth(250);
fieldSet.setHeight(150);
fieldSet.add(main);
fieldSet.setPosition(5, 5);

add(fieldSet);
}

}

Is there something wrong in this code?

When loading this js with iexplorer, sometimes it works, but other times just hangs without any other option than close the browser using the task manager.

With firefox, Safari and Chrome works fine.

Thanks

fjulbe
7 Nov 2008, 1:09 AM
Nobody expecienced this problem?

gslender
7 Nov 2008, 3:13 AM
it looks like you are not sizing the MainEntryPoint when you adding it RootPanel

call setSize(500,500); and see if that works - if so, try using a viewport to size with browser