PDA

View Full Version : TextField overflow problem on FF3.5



micgala
18 Dec 2009, 5:31 AM
Hi.

Please try to run the following code on FF3.5

Click on the Show Window button, then click on the Current Password field, and then click somewhere else, so the field is marked as invalid (must not be empty).
Then, close the window, and click the Show Window button again.
You will see that a horizontal scrollbar appear for the Current Password field (as seen in the attached image).



public class StartupEntryPoint implements EntryPoint {

private Window dialog;
private TextField<String> currentPassword;
private TextField<String> newPassword;
private TextField<String> retypeNewPassword;
private FormPanel formPanel;

public void onModuleLoad() {

prepareWindow();

ContentPanel cp = new ContentPanel();
cp.setLayout(new FitLayout());

Button show = new Button("Show Window");
show.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
dialog.show();
}
});

cp.addButton(show);

Viewport viewport = new Viewport();
viewport.add(cp, new MarginData(10));
RootPanel.get().add(viewport);
}

private void prepareWindow() {
dialog = new Window();
dialog.setLayout(new RowLayout());
dialog.setSize(400, 180);
dialog.setResizable(false);
dialog.setModal(true);
dialog.setBodyStyle("backgroundColor:white");
dialog.setHeading("Test");

dialog.add(prepareFormPanel());

dialog.addListener(Events.Hide, new Listener<WindowEvent>() {
public void handleEvent(WindowEvent be) {
currentPassword.setValue(null);
currentPassword.clearInvalid();
newPassword.setValue(null);
newPassword.clearInvalid();
retypeNewPassword.setValue(null);
retypeNewPassword.clearInvalid();
}
});
}

private FormPanel prepareFormPanel() {
formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setBorders(false);
formPanel.setBodyBorder(false);
formPanel.setLabelWidth(140);

currentPassword = new TextField<String>();
currentPassword.setPassword(true);
currentPassword.setFieldLabel("Current Password");
currentPassword.setHideLabel(false);
currentPassword.setAllowBlank(false);
formPanel.add(currentPassword, new FormData("95%"));

newPassword = new TextField<String>();
newPassword.setPassword(true);
newPassword.setFieldLabel("New Password");
newPassword.setHideLabel(false);
newPassword.setAllowBlank(false);
formPanel.add(newPassword, new FormData("95%"));

retypeNewPassword = new TextField<String>();
retypeNewPassword.setPassword(true);
retypeNewPassword.setFieldLabel("Retype New");
retypeNewPassword.setHideLabel(false);
retypeNewPassword.setAllowBlank(false);
formPanel.add(retypeNewPassword, new FormData("95%"));

return formPanel;
}
}

sven
18 Dec 2009, 5:42 AM
Are you sure that you are using the latest CSS files? I cannot reproduce this. I will move this to the help forum so more people might see this.

micgala
18 Dec 2009, 5:46 AM
Yes, I am using the latest css files.
That is very strange...

Me and a couple of other people had this also with older versions (2.0.1)...
And, that time, you were also not able to recreate this...

sven
18 Dec 2009, 5:47 AM
It was a mac only issue and was fixed with a css fix. I tested it with my mac now and it works without problems.

micgala
18 Dec 2009, 5:53 AM
I am able to recreate on Windows and Mac...
Hopefully others can try...

sven
18 Dec 2009, 5:55 AM
Can you please upload your testcase somewhere, so i can access it over http?

If you dont want to make the link public, send it to me with a PM.

micgala
18 Dec 2009, 6:20 AM
NP, I have just created a new project, completely from scratch, using gwt 2.0.

I was able to recreate it also there.

The project files are available here:

http://drop.io/micgala

Regards,
Michel.

sven
18 Dec 2009, 6:23 AM
the gxt-all.css file from war/mywebapp/gxt/css is from 2.0.0 not 2.1.0, the one inside the public dir also.

micgala
18 Dec 2009, 6:41 AM
Damn... you are so right... :)

Sorry about that... I was probably confused about the gwt migration as well (2.0).
And probably used both 2.0 (gwt and gxt resources).

Tks anyway, for the prompt replies and effort.

Regards,
Michel.

sven
18 Dec 2009, 7:08 AM
So it is working now?

micgala
18 Dec 2009, 7:15 AM
Yes, it is working now (after using gxt 2.1.0 resources).

Tks and regards,
Michel.