TextArea.setValue() Need Help

Hi to All!!!

I have some problem with TextArea.setValue().
To cut the story short I have a code snipet like:


TextArea textArea;

public void init() {
		mainWindow = new Window();
		setMainWindow(mainWindow);

        textArea = new TextArea("TextArea");
		textArea.setImmediate(true);
		textArea.setWordwrap(true);
		textArea.setSizeFull();

        mainWindow.addComponent(textArea);
        ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
        scheduler.scheduleWithFixedDelay(new Runnable() {
			
			@Override
			public void run() {
			        textArea.setValue("some text");
			}

		}, 0, 10, TimeUnit.SECONDS);

}

But when scheduler is triggered textArea.setValue() has no effect until resize Window.

[b]

So, the question is what should I do to make textArea.setValue() have effect when scheduler is triggered?

[/b]

Thanks…

Hey,

and why should the frontend refresh the content of the textarea? Or better: how should the html in the browser know that there is a change waiting to be rendered?

Even though Vaadin looks almost like a desktop application it behaves diffrently, because the communication between the client-side and the server-side is done asynchronously. Maybe in future this could be improved with websockets but this is for the vaadin developers to decide( and considering the IE nightmare …)

For the moment you should consider using someting like:
http://vaadin.com/directory#addon/refresher

I hope this answer satisfyingly answers your question.

Cheers,

Christoph

I tried to use http://vaadin.com/directory#addon/refresher but got:

Widgetset does not contain implementation for com.github.wolfie.refresher.Refresher. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:

com.github.wolfie.refresher.Refresher(NO CLIENT IMPLEMENTATION FOUND)

So, what my problem is?

Help somebody!!!

Hey,

for a new ui component to work, you need to recompile the widget set.
You do this via the vaadin eclipse plugin. You also have to add the custom
widget set to your servlet mapping.

You can also skip the add-on and just
set a text change event mode
to LAZY and start listening to text change events.

Biggg thanks for help :lol:

One more question about TextArea widget:

how to scroll to given position or to end of the text?