Notification Issue

I’m using vaadin-7.0-20120425.000930-79.

Below is the code, on submit the value in the text field gets incremented but the notification is not shown. However on refresh (or click AL) the message is notified. I’m not sure if this is a bug, please let me know. (I think this code was working fine earlier)


        @Override
	protected void init(WrappedRequest request) {
		getApplication().setRootPreserved(true);
		createForm();
	}
	int i = 0;
	private void createForm() {
		HorizontalLayout horizontalLayout = new HorizontalLayout();
		final TextField field = new TextField();
		field.setValue(i + "");
		Button btn = new Button("Submit", new ClickListener() {
			public void buttonClick(ClickEvent event) {
				i++;
				field.setValue(i + "");
				getRoot().showNotification("Updated!");
			}
		}); 
		horizontalLayout.addComponent(field);
		horizontalLayout.addComponent(btn);
		addComponent(horizontalLayout);
	}

and from Debug window

[size=1]
01:52:39:451 Variable burst to be sent to server:
01:52:39:456 	4 (class com.vaadin.terminal.gwt.client.ui.button.ButtonConnector) :
01:52:39:456 		com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc.click([1,195,25,false,false,false,false,1,44,7]
)
01:52:39:458 Making UIDL Request with params: afb79137-881d-49a1-acff-21e688cc5158[["4","com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc","click",[["com.vaadin.terminal.gwt.client.MouseEventDetails",{"Button":["i","1"]
, "ClientX":["i","195"]
, "ClientY":["i","25"]
, "AltKey":["b",false]
, "CtrlKey":["b",false]
, "MetaKey":["b",false]
, "ShiftKey":["b",false]
, "Type":["i","1"]
, "RelativeX":["i","44"]
, "RelativeY":["i","7"]
}]]]]
01:52:39:475 Server visit took 17ms
01:52:39:476 JSON parsing took 0ms
01:52:39:477 Handling message from server
01:52:39:477  * Handling resources from server
01:52:39:478  * Handling type inheritance map from server
01:52:39:479 Handling type mappings from server
01:52:39:479  * Handling locales
01:52:39:480  * Handling meta information
01:52:39:480  * Creating connectors (if needed)
01:52:39:480  * Updating connector states
01:52:39:481  * Updating connector hierarchy
01:52:39:481  * Sending state change events
01:52:39:482  * Passing UIDL to Vaadin 6 style connectors
01:52:39:483 * Unregistered 0 connectors
01:52:39:483 handleUIDLMessage: 3 ms
01:52:39:484 Starting layout phase
01:52:39:487 Measured 10 non connector elements
01:52:39:487 Layout init in 3 ms
01:52:39:489   Measured 5 elements in 1 ms
01:52:39:491 Pass 1 completed in 3 ms
01:52:39:491 No more changes in pass 2
01:52:39:492 Invoke post layout listeners in 0 ms
01:52:39:492 Total layout phase time: 8ms
01:52:39:493  * Layout processing completed: 10 ms
01:52:39:493  Processing time was 17ms for 635 characters of JSON
01:52:39:494 Referenced paintables: 5
[/size]

Hi,

I just copy/paste your code, use the same vaadin version and it’s works perfectly well.8o

Yup, its working (not sure why this was not working earlier - may be recompilation/hot deploy issue)