Search code examples
smartgwtgwt2

smartgwt beginner- how to show a text area within a tab, then execute some javascript code in it


I am trying to show a text area within a tab in a test application. I am using Smart GWT 3.0 LGPL Edition.

I can only see a way to display a rich text area as a widget- I would however like to display a plain text area within the tab. How do I do this? Do I have to declare a form within the tab, and then declare the text area within the form?

Also, I want to execute some custom Javascript code on the text area- do I do this using JSNI? Is there any limitation in Smart GWT's impl. of text area that I should be aware of, to use JSNI to run custom javascript code?


Solution

  • Yes, the only way to have a text area is through a form declaration in your tab. The text area shall be set as the form's item.

    Generally, bringing Javascript code inside GWT is achieved through JSNI. Your question's second part is a bit broad and I can't think of something that would pose any limitations. But IMHO you should try to achieve what you want through the GWT methods.