Re: Getting the RichTextArea to expand as you type
tried the other solution in this thread with visibility:hidden html widget... works but need white space on page and real estate issues as whitespace grows with the growing richtextarea, based on this reply, how can you know on keyup or keydown weather you have a scrollbar in RichTextarea which has become visible, so can start resizing? couldn't find any api to query? Cheers... -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/WaHMCz2cN-QJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Getting the RichTextArea to expand as you type
sorry for the delay, anyway "myHTML" was a typo. Sorry about that. You should do sth like /* an GWT HTML you have to place somewhere in the page then associate a css rule like visibility: hidden in order to make the browser not showing it. */ HTML divHidden = new HTML(); ... ... ... public void onKeyUp(Widget sender, char keyCode, int modifiers) { RichTextArea rta = (RichTextArea) sender; divHidden.setHTML(rta.getHTML()); rta.setHeight(""+ (divHidden.getOffsetHeight())); } M. On 29 Set, 17:01, James Tamplin wrote: > M - > > Canyoupost the whole solution. I'm unsure exactly how myHTML and > divHidden fit in. > > Thanks. > > On Sep 8, 3:57 am, "m.assa...@gmail.com" wrote: > > > > > I solved the issue by associating a keyboardlistener to thetextarea > > which copies > > thetextareacontents into a GWT HTML Element and get its height. > > (Thenyouresize thetextareawith the new HTML Element height) > > > in the keyboard listeneryoudo sth like > > > public void onKeyUp(Widget sender, char keyCode, int modifiers) { > > RichTextArea rta = (RichTextArea) sender; > > myHTML.setHTML(rta.getHTML()); > > > rta.setHeight(""+ > > (divHidden.getOffsetHeight())); > > } > > > hope this helps. > > M. > > >Youshould associate a css rule like visibility: hidden to the HTML > > Element in order to make the browser not showing it. > > > On Aug 26, 1:26 am, Arthur Kalmenson wrote: > > > > Yes, that is the way to do this. > > > > -- > > > Arthur Kalmenson > > > > On Thu, Aug 20, 2009 at 2:09 PM, Yossi wrote: > > > > > Someone please answer, it is very important for me. > > > > I need it to expand only vertically and not horizontally > > > > > I am thinking of adding an event listener for the keyboard and mouse > > > > and on each event I willcheckif there are scrollbars - if there are, > > > > I will increase the height, if there aren't I will decrease. > > > > > Thanks > > > > > On 12 Aug, 14:27, LuminariGWT wrote: > > > >> I'm trying to use the GWTRichTextArea. I would like the size of the > > > >> area to expand vertically asyoutype, so there is never ascrollbar. > > > >> Any ideas on how I can accomplish this? > > > > >> overflow:visible; doesn't work > > > > >> Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Getting the RichTextArea to expand as you type
I had a lot of fun with this problem. My solution was to increase/ decrease the row attribute of the textarea as the user types. It's not perfect but it behaves as expected and executes fast. Source code for my widget here: http://pastie.org/635638 I'd be interested if you folks have any critiques or insights. Hope this helps! On Sep 29, 11:01 am, James Tamplin wrote: > M - > > Can you post the whole solution. I'm unsure exactly how myHTML and > divHidden fit in. > > Thanks. > > On Sep 8, 3:57 am, "m.assa...@gmail.com" wrote: > > > I solved the issue by associating a keyboardlistener to thetextarea > > which copies > > thetextareacontents into a GWT HTML Element and get its height. > > (Then you resize thetextareawith the new HTML Element height) > > > in the keyboard listener you do sth like > > > public void onKeyUp(Widget sender, char keyCode, int modifiers) { > > RichTextArea rta = (RichTextArea) sender; > > myHTML.setHTML(rta.getHTML()); > > > rta.setHeight(""+ > > (divHidden.getOffsetHeight())); > > } > > > hope this helps. > > M. > > > You should associate a css rule like visibility: hidden to the HTML > > Element in order to make the browser not showing it. > > > On Aug 26, 1:26 am, Arthur Kalmenson wrote: > > > > Yes, that is the way to do this. > > > > -- > > > Arthur Kalmenson > > > > On Thu, Aug 20, 2009 at 2:09 PM, Yossi wrote: > > > > > Someone please answer, it is very important for me. > > > > I need it to expand only vertically and not horizontally > > > > > I am thinking of adding an event listener for the keyboard and mouse > > > > and on each event I willcheckif there are scrollbars - if there are, > > > > I will increase the height, if there aren't I will decrease. > > > > > Thanks > > > > > On 12 Aug, 14:27, LuminariGWT wrote: > > > >> I'm trying to use the GWTRichTextArea. I would like the size of the > > > >> area to expand vertically as you type, so there is never ascrollbar. > > > >> Any ideas on how I can accomplish this? > > > > >> overflow:visible; doesn't work > > > > >> Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Getting the RichTextArea to expand as you type
M - Can you post the whole solution. I'm unsure exactly how myHTML and divHidden fit in. Thanks. On Sep 8, 3:57 am, "m.assa...@gmail.com" wrote: > I solved the issue by associating a keyboardlistener to thetextarea > which copies > thetextareacontents into a GWT HTML Element and get its height. > (Then you resize thetextareawith the new HTML Element height) > > in the keyboard listener you do sth like > > public void onKeyUp(Widget sender, char keyCode, int modifiers) { > RichTextArea rta = (RichTextArea) sender; > myHTML.setHTML(rta.getHTML()); > > rta.setHeight(""+ > (divHidden.getOffsetHeight())); > } > > hope this helps. > M. > > You should associate a css rule like visibility: hidden to the HTML > Element in order to make the browser not showing it. > > On Aug 26, 1:26 am, Arthur Kalmenson wrote: > > > Yes, that is the way to do this. > > > -- > > Arthur Kalmenson > > > On Thu, Aug 20, 2009 at 2:09 PM, Yossi wrote: > > > > Someone please answer, it is very important for me. > > > I need it to expand only vertically and not horizontally > > > > I am thinking of adding an event listener for the keyboard and mouse > > > and on each event I willcheckif there are scrollbars - if there are, > > > I will increase the height, if there aren't I will decrease. > > > > Thanks > > > > On 12 Aug, 14:27, LuminariGWT wrote: > > >> I'm trying to use the GWTRichTextArea. I would like the size of the > > >> area to expand vertically as you type, so there is never ascrollbar. > > >> Any ideas on how I can accomplish this? > > > >> overflow:visible; doesn't work > > > >> Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Getting the RichTextArea to expand as you type
I solved the issue by associating a keyboardlistener to the textarea which copies the textarea contents into a GWT HTML Element and get its height. (Then you resize the textarea with the new HTML Element height) in the keyboard listener you do sth like public void onKeyUp(Widget sender, char keyCode, int modifiers) { RichTextArea rta = (RichTextArea) sender; myHTML.setHTML(rta.getHTML()); rta.setHeight(""+ (divHidden.getOffsetHeight())); } hope this helps. M. You should associate a css rule like visibility: hidden to the HTML Element in order to make the browser not showing it. On Aug 26, 1:26 am, Arthur Kalmenson wrote: > Yes, that is the way to do this. > > -- > Arthur Kalmenson > > On Thu, Aug 20, 2009 at 2:09 PM, Yossi wrote: > > > Someone please answer, it is very important for me. > > I need it to expand only vertically and not horizontally > > > I am thinking of adding an event listener for the keyboard and mouse > > and on each event I willcheckif there are scrollbars - if there are, > > I will increase the height, if there aren't I will decrease. > > > Thanks > > > On 12 Aug, 14:27, LuminariGWT wrote: > >> I'm trying to use the GWTRichTextArea. I would like the size of the > >> area to expand vertically as you type, so there is never ascrollbar. > >> Any ideas on how I can accomplish this? > > >> overflow:visible; doesn't work > > >> Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Getting the RichTextArea to expand as you type
Yes, that is the way to do this. -- Arthur Kalmenson On Thu, Aug 20, 2009 at 2:09 PM, Yossi wrote: > > Someone please answer, it is very important for me. > I need it to expand only vertically and not horizontally > > I am thinking of adding an event listener for the keyboard and mouse > and on each event I will check if there are scrollbars - if there are, > I will increase the height, if there aren't I will decrease. > > Thanks > > On 12 Aug, 14:27, LuminariGWT wrote: >> I'm trying to use the GWTRichTextArea. I would like the size of the >> area to expand vertically as you type, so there is never a scrollbar. >> Any ideas on how I can accomplish this? >> >> overflow:visible; doesn't work >> >> Thanks > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Getting the RichTextArea to expand as you type
Someone please answer, it is very important for me. I need it to expand only vertically and not horizontally I am thinking of adding an event listener for the keyboard and mouse and on each event I will check if there are scrollbars - if there are, I will increase the height, if there aren't I will decrease. Thanks On 12 Aug, 14:27, LuminariGWT wrote: > I'm trying to use the GWTRichTextArea. I would like the size of the > area to expand vertically as you type, so there is never a scrollbar. > Any ideas on how I can accomplish this? > > overflow:visible; doesn't work > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Getting the RichTextArea to expand as you type
I'm trying to use the GWT RichTextArea. I would like the size of the area to expand vertically as you type, so there is never a scrollbar. Any ideas on how I can accomplish this? overflow:visible; doesn't work Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---