GWT-Textarea Problem

176 views
Skip to first unread message

tnagarnaik

unread,
Oct 9, 2012, 11:11:18 AM10/9/12
to Google-We...@googlegroups.com
Hello,
I am currently working on a module in which I want that logs should be
fetched from the server and should get displayed on client in a Textarea(GUI)
continuously.How can I append the new data at the end of already present
information in textarea and is there any function for getting the info
continuously from the server because the function is returning a single String?
Plz do reply as soon as possible.Thanks.

Richard

unread,
Oct 9, 2012, 3:23:41 PM10/9/12
to google-we...@googlegroups.com, Google-We...@googlegroups.com, tnaga...@gmail.com
textArea.setText(textArea.getText() + newText); should let you append the data.

To get data continuously you'll either need to poll the server, which will be expensive if you have many clients, or use something like long-polling to push data from the server to each client as it's generated. That'll be more work, but it's probably the right way to do it.  Maybe poll for now, and then add comet when you have time.

http://code.google.com/p/gwt-comet/ for one implementation of the client side.

Andrei

unread,
Oct 10, 2012, 7:14:03 AM10/10/12
to google-we...@googlegroups.com
TextArea is used for user input. If you continuously add text to it programmatically for display purposes only, you are using the wrong widget. Use HTML widget instead.
Reply all
Reply to author
Forward
0 new messages