Given this small program, I'm unable to figure out how to get the scroll
container to scroll back to the top.  Setting a selected radio button after
the window has appeared switches the focus (and scrolls) to the selected
button, but setting focus to a text field at the top does not have a similar
effect nor does explicitly setting the scroll location.  Is this a bug, or
am I missing some feature?

/*
#require(qx.log.appender.Native)
#require(qx.log.appender.Console)
*/

qx.Class.define("custom.Application",
{
  extend : qx.application.Standalone,
  members :
  {
    main: function()
    {
      this.base(arguments);

      var container = new qx.ui.container.Composite(new
qx.ui.layout.VBox());
      this.getRoot().add(container);

      win = new qx.ui.window.Window("Test of embedded Scroll container");
      win.setLayout(new qx.ui.layout.VBox());
      win.set(
        {
          width: 600,
          height: 400,
          modal: true,
          showClose: false,
          showMaximize: false,
          showMinimize: false
        });

      var scrollContainer = new qx.ui.container.Scroll();
      scrollContainer.setMaxHeight(400);
      win.add(scrollContainer, { flex : 1 });

      var scroller = new qx.ui.container.Composite(new qx.ui.layout.VBox());
      scrollContainer.add(scroller);

      var o;
      var hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(4));
      scroller.add(hBox);

      o = new qx.ui.basic.Label("hello world");
      o.setHeight(50);
      hBox.add(o);

      var textField = new qx.ui.form.TextField();
      hBox.add(textField);

      win.open();

      qx.event.Timer.once(
        function()
        {
          var group = new qx.ui.form.RadioGroup();

          for (var i = 1; i < 100; i++)
          {
            o = new qx.ui.form.RadioButton("Option " + i);
            scroller.add(o);

          if (i == 70)
            {
              group.setSelected(o);
            }
          }

          textField.focus();                    // HAS NO EFFECT
          scrollContainer.scrollToY(0);         // HAS NO EFFECT
        },
        this,
        20);
    }
  }
});
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to