Re: [qooxdoo-devel] Adding "modelPath" property to qx.data.controller.List
Brought to you by:
ecker,
martinwittemann
From: Guilherme A. <gr...@gm...> - 2011-10-31 21:03:27
|
After binding the "model" to "model.id" in your controller you wont loose any data. That would be insane. Your model is still the same. What changes is the object in the controller's selection (that is a reference to the widget's selection). On Mon, Oct 31, 2011 at 7:57 AM, omrihar <om...@gm...> wrote: > Sorry if I was being unclear, I will try to make myself better understood > by > a simplified example: > > Lets say I have a SelectBox which is filled by data from a relational > database and which is part of a form. > Now lets say that the label of each item in the select box should be > composed from two different fields in the model - e.g First Name and Last > Name. > For that to work I need to define a converter which returns something like > model.getFirstName() + " " + model.getLastName(). > > Now, this SelectBox is part of a form which allows you to select a person. > Obviously what interests you when you get the data from the form is only > the > ID field related to the person selected earlier, not the entire model of > the > selected person. The way to achieve that would be to bind the "model" > property of the select box to its "model.id" property. Now if I need to > access other data stored within the model I cannot, because it has been > replaced by model.id, and unless I am mistaken, the previous converter > will > no longer function, because "model" is replaced by "model.id" and > properties > such as the firstName and lastName are no longer available. > > That is what I mean by two uses of the word "model". One is when we are > only > interested in "model.id" and the other is when we're interested in the > entire data structure which is related to the person (in this example). > > Am I making any sense or did I misunderstand something completely? > > -- > View this message in context: > http://qooxdoo.678.n2.nabble.com/Adding-modelPath-property-to-qx-data-controller-List-tp6648554p6947576.html > Sent from the qooxdoo mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Get your Android app more play: Bring it to the BlackBerry PlayBook > in minutes. BlackBerry App World™ now supports Android™ Apps > for the BlackBerry® PlayBook™. Discover just how easy and simple > it is! http://p.sf.net/sfu/android-dev2dev > _______________________________________________ > qooxdoo-devel mailing list > qoo...@li... > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > |