Hi Marting,

I attached the code that I use.
I think the problem come from the way I call the XTP class. Because when I put in the playground just the XTP class, there's no problem!

I don't know if is the best way to call a class.

--
Best Regards,
Ricardo Ferreira

On 15-07-2010 12:23, MartinWittemann wrote:
Hello Ralf,
this behavior is not a big surprise for me. The form controller maps the
selected model of the select box to the form model. If you use the
controller, the selected model will be assigned corresponding to the models
in the model supplied to the list controller.
As in your case, you added some list items which don't have their model
property set and this leads to null in the forms model and I guess to all
other wrong behavior.

       gender.add( new qx.ui.form.ListItem( "male", null, "MALE" ) );
       gender.add( new qx.ui.form.ListItem( "female", null, "FEMALE" ) );

... fixes the whole problem and leads to "MALE" and "FEMALE" in the form
model. As you can guess, you can use any kind of object you want, even if
its an object or only a number.
Regards,
Martin
/* ************************************************************************

   Copyright:

   License:

   Authors:

************************************************************************ */

/* ************************************************************************

#asset(asd/*)

************************************************************************ */

/**
 * This is the main application class of your custom application "asd"
 */
qx.Class.define("asd.Application",
{
  extend : qx.application.Standalone,



  /*
  *****************************************************************************
     MEMBERS
  *****************************************************************************
  */

  members :
  {
    /**
     * This method contains the initial application code and gets called
     * during startup of the application
     *
     * @lint ignoreDeprecated(alert)
     */
    main : function()
    {
      // Call super class
      this.base(arguments);

      // Enable logging in debug variant
      if (qx.core.Variant.isSet("qx.debug", "on"))
      {
        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;
        // support additional cross-browser console. Press F7 to toggle 
visibility
        qx.log.appender.Console;
      }

      /*
      -------------------------------------------------------------------------
        Below is your actual application code...
      -------------------------------------------------------------------------
      */

      qx.locale.Manager.getInstance().setLocale("en");

      var xtp = new asd.XTP();
      xtp.main();

    }
  }
});
qx.Class.define("asd.XTP",
{
  extend : qx.application.Standalone,

  members :
  {
    __container : null,

    main: function()
    {
      this.base(arguments);

      /* Container layout */
      var layout = new qx.ui.layout.Grid(9, 5);
      layout.setColumnAlign(0, "right", "top");
      layout.setColumnAlign(2, "right", "top");

      /* Container widget */
      this.__container = new qx.ui.groupbox.GroupBox().set({
        contentPadding: [16, 16, 16, 16]
      });
      this.__container.setLayout(layout);

      this.__container.addListener("resize", function(e)
      {
        var bounds = this.__container.getBounds();
        this.__container.set({
          marginTop: Math.round(-bounds.height / 2),
          marginLeft : Math.round(-bounds.width / 2)
        });
      }, this);

      this.getRoot().add(this.__container, {left: "50%", top: "50%"});

      /* Text fields */
      var field0 = new qx.ui.form.SelectBox();
      var field1 = new qx.ui.form.TextField();
      var field2 = new qx.ui.form.PasswordField();
      var field3 = new qx.ui.form.SelectBox();
      for (var i=0; i<3; i++)
      {
        field0.add(new qx.ui.form.ListItem("SelectBox1 [" + (i+1) + "]"));
      }
      for (var i=0; i<30; i++)
      {
        field3.add(new qx.ui.form.ListItem("SelectBox2 [" + (i+1) + "]"));
      }
      var container1 = new qx.ui.container.Composite(new qx.ui.layout.VBox(2));
      var container2 = new qx.ui.container.Composite(new qx.ui.layout.VBox(2));
      container1.add(field0);
      container2.add(field3);

      this.__container.add(container1.set({
        allowShrinkX: false,
        paddingTop: 3
      }), {row : 0, column : 1});

      field1.focus();
      this.__container.add(field1.set({
        allowShrinkX: false,
        paddingTop: 3
      }), {row : 1, column : 1});

      this.__container.add(field2.set({
        allowShrinkX: false,
        paddingTop: 3
      }), {row : 2, column : 1});

      this.__container.add(container2.set({
        allowShrinkX: false,
        paddingTop: 3
      }), {row : 3, column : 1});

    }
  },

  /*
   *****************************************************************************
      DESTRUCTOR
   *****************************************************************************
   */

  destruct : function()
  {
    this._disposeObjects("__container");
  }
});
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to