Textfield values sometimes not coming thru after I edit them and button cli

Textfield values sometimes not coming thru after I edit them and button click event

I am trying run the demo of the hibernate with vaadin from
http://vaadin.com/wiki/-/wiki/Main/Using%20Hibernate%20with%20Vaadin?p_r_p_185834411_title=Using+Hibernate+with+Vaadin

I installed it and the GUI works, but there is a problem: When I double click on a row in the table, it pops up the ‘Edit Window’ and I edit the textfields ‘kilometers’ and ‘title’ putting some values and click on SAVE button. After the save, the values are not stored. Sometimes it works and sometimes it does. Sometime only of the textfield either title or kilometer field is being saved.

What is the problem? I put a breakpoint in buttonClick(ClickEvent event) at this line 56
} else if (event.getButton() == save) {
And here I find the textfield value is sometimes comes correct and other times has previous old value.
See this WorkoutEditor.java below


public class WorkoutEditor extends Window implements ClickListener {
	private static final long serialVersionUID = 6569779390222502305L;
	private DateField date = new DateField("Date");
	private TextField kilomiters = new TextField("Kilometers");
	private TextField title = new TextField("Title/note");
	private Button save = new Button("Save");
	private Button delete = new Button("Delete");
	private Workout run;
	private WorkoutLog workoutLog;

	public WorkoutEditor(WorkoutLog app) {
		super("Edit workout popup");
		workoutLog = app;
		this.setImmediate(true);
		this.title.setImmediate(true);
		this.kilomiters.setImmediate(true);
		Layout main = new VerticalLayout();
		this.setContent(main); // deprecated setLayout(main);
		main.setSizeUndefined();
		main.setStyleName(Panel.STYLE_LIGHT);
		FormLayout form = new FormLayout();
		form.setSizeUndefined();
		date.setResolution(DateField.RESOLUTION_MIN);
		form.addComponent(date);
		form.addComponent(kilomiters);
		form.addComponent(title);
		main.addComponent(form);
		HorizontalLayout actions = new HorizontalLayout();
		actions.addComponent(save);
		save.addListener(this);
		actions.addComponent(delete);
		delete.addListener(this);
		main.addComponent(actions);
	}

	public void loadRun(Workout run) {
		if (run == null) {
			close();
		} else {
			date.setValue(run.getDate().clone());
			kilomiters.setValue("" + run.getKilometers());
			title.setValue("" + run.getTitle());
			if (getParent() == null) {
				workoutLog.getMainWindow().addWindow(this);
			}
			kilomiters.focus();
			this.run = run;
		}
	}

	public void buttonClick(ClickEvent event) {
		if (event.getButton() == delete) {
			workoutLog.deleteRow(run);
		} else if (event.getButton() == save) {
			run.setDate((Date) this.date.getValue());
			run.setKilometers(Float.parseFloat(this.kilomiters.getValue().toString()));
			run.setTitle((String) this.title.getValue());
			workoutLog.persistRow(run);
		}
		if (getParent() != null) {
			((Window) getParent()).removeWindow(this);
		}
	}
}

Hi,

I tested the hbncontainer Workout demo from
http://dev.vaadin.com/svn/incubator/hbncontainer
with Vaadin 6.2.2 and could not see any of the issues you describe. I also tried the WorkoutEditor you posted (after renaming some methods so it works with the svn project) and did not experience any problems. Any special setup you are using? Other code changes you have made that might affect the outcome? Does this happen in any particular browser but not in others?

This problem occurs in MS IE browser version 7.0 and in Eclipse IDE internal web browser.
And I tested with Firefox browser and it does not happen there.

Any idea why this is happening in MS IE and eclipse internal browser ?

Eclipse uses the default IE installed on a windows system so it would then be related to IE7. I tried it in IE8 in IE7 compatibility mode but could see no problems there either.

It is not a problem with VAADIN but it is problem with Microsoft Internet Explorer MSIE 7.x .
MSIE 7.x is EXTREMELY BUGGY and very unreliable. It breaks most of the web applications in the world.

You must do lot of sit-ups and struggle and configure the MSIE 7.x to make it work.

Since Vaadin is based on GWT and the Google Web Toolkit GWT will NOT work on MSIE 7.x properly.
See this posting “GWT applications do not run in IE 7”


http://code.google.com/p/google-web-toolkit/issues/detail?id=153

And also the changes you need to make to MSIE 7.x to make it work.


http://lkamal.blogspot.com/2007/08/gwt-ie7-element-not-found.html

Damn, throw out MSIE 7.x and upgrade to MSIE 8.x