Announcement

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

    Problem with Window scrollTO

    Hi,
    I have a problem with method scrollTo.
    example:
    Code:
    Window  window = new Window();
      window.setWidth(500);
      Label label = new Label("hello");
      label.setBackgroundColor("red");
      label.setWidth(1200);  
      window.addItem(label);
    RootPanel.get("main").add(window);
    I would like to have a scrolled window to see the end (or middle) of label.
    I tried following but it does not work:
    window.scrollToRight();
    window.scrollTo(1000,0);
    and
    label.scrollToRight();

    I didn't find the answer in all posts concerned with scrolling in forum.
    Can anybody help ?
    Last edited by jatoma; 8 Jul 2010, 04:51.

    #2
    hi,

    maybe with
    Code:
    setOverlow(Overflow.AUTO);
    on a layout

    Comment


      #3
      I have set

      Code:
       window.setOverflow(Overflow.AUTO);
      but it still does not work. I also tried with others overflows values
      on a window and Hlayout component
      but all this options does not work. Solution for this problem is very important for me. Does anybody help ?
      Last edited by jatoma; 8 Jul 2010, 07:00.

      Comment


        #4
        Isomorphic Can you help me ?
        I am writing my master's thesis and I really need solution for above problem.

        Comment


          #5
          Here try this:

          Code:
          public class MyWindow extends Window {
            public native void myScrollTo(int x, int y) /*-{
              var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
              self.body.scrollTo(x, y);
            }-*/;
          };
          
          public void onModuleLoad() {
          	final MyWindow window = new MyWindow();
          	window.setOverflow(Overflow.VISIBLE);
          	window.setWidth(500);
          	final Label label = new Label("hello");
          	label.setBackgroundColor("red");
          	label.setWidth(1200);
          	window.addItem(label);
          	window.draw();
          
          	IButton b = new IButton("Scroll");
          	b.addClickHandler(new ClickHandler() {
          		@Override
          		public void onClick(ClickEvent event) {
          			window.myScrollTo(1000, 10);
          		}
          	});
          
          	b.draw();
          }
          Move the window, since it will be on top of the button, but then click the button and the window should scroll.

          Comment


            #6
            nice workaround, but works. thanks a lot.

            Comment


              #7
              Curious: What is your master's thesis on to require this?

              Comment


                #8
                I am creating Project Management Tool. Main functionalities are :

                - Remote presentation (used: GwtEventService, status:done )
                - BugTracker (partially done)
                - Gantt chart for this I need scrollable window to show all tasks for particulary (day,week,month) (I am working on this now)
                -IDE(netbeans,eclipse) simply plugin which can connect to service and set progress of task.(done)

                Used technologies

                GUI: SmartGWT in 95%.
                EJB 3.1
                Communication: GWT-RPC

                I am determinated becouse I don't have much time(heh as usualy in IT projects everything is on yesterday :))

                Regards
                Tomek

                Comment

                Working...
                X