Shouldn't you use a list controller for that?

On Wed, Nov 10, 2010 at 8:27 PM, panyasan <[email protected]> wrote:

>
> Hi,
>
> I think I know what Omri means, and it is not as easy as that, it seems to
> me.
> For example, if you want to sync a form model with the token field, you
> need
> to create the items first, because a selection can only be set from items
> that already exist in the widget.
>
> Here is how I do it: I subclass the TokenField widget class and add a
> method:
>
>    /**
>     * Creates a token from ListItem model data and adds it to the
>     * widget
>     * @param itemModelData {Object}
>     */
>    addToken : function( itemModelData )
>    {
>      var item = new qx.ui.form.ListItem( itemModelData.label )
>      item.setModel( qx.data.marshal.Json.createModel( itemModelData ) );
>      this._selectItem( item );
>    }
>
> Cheers,
> Christian
>
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/Prepopulating-a-TokenField-widget-tp5724596p5726809.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Centralized Desktop Delivery: Dell and VMware Reference Architecture
> Simplifying enterprise desktop deployment and management using
> Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
> client virtualization framework. Read more!
> http://p.sf.net/sfu/dell-eql-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to