Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Allowing text to be selected inside GWT Widget

    I have a classic GWT widget that I'm inserting inside a SmartGWT VStack. I need to allow the user to select the text.

    Here's a runnable code :

    Code:
    final Element div = DOM.createDiv();
    		div.setInnerText("I want to be able to select this text");
    
    		Widget widget = new Widget()
    		{
    			{
    				setElement(div);
    			}
    		};
    
    		widget.setHeight("100%");
    		widget.setWidth("100%");
    
    		VStack stack = new VStack();
    		stack.addMember(widget);
    		stack.setCanSelectText(true);
    
    		stack.show();
    Can someone guide me on how to allow text selection in this particular case ?
    Last edited by jmichelgarcia; 22 Jun 2012, 02:37.

    #2
    Solved wrapping the Widget with WidgetCanvas :

    WidgetCanvas widgetCanvas = new WidgetCanvas(widget); widgetCanvas.setCanSelectText(true);

    Comment

    Working...
    X