Blew code can make RichTextArea auto-grow-or-shrink vertically based on
KeyUp event,and question is how to do same thing when user paste or cut
content in or out(Google plus has implemented this).MouseUp and
CONTEXTMENU events have been tried,got no luck.Can anybody give a
solution?Thanks.

public AutoResizeTextArea()
{
    new Timer()
    {
        @Override
        public void run()
        {
            (doc = ((FrameElement)
getElement().cast()).getContentDocument()).getBody()
                    .setAttribute("style",
"word-wrap:break-word;overflow:hidden;");
        }
    }.schedule(100);
}


@Override
public void onBrowserEvent(Event event)
{
    switch (DOM.eventGetType(event))
    {
        case Event.ONKEYUP:
            adjustHeight();
            break;
    }
}

private void adjustHeight()
{
    if (doc.getDocumentElement()
            .getOffsetHeight() != doc.getClientHeight())
    {
        setHeight((doc.getDocumentElement()
                .getOffsetHeight() + 19) + "px");
    }
}

-- 
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.

Reply via email to