Hi Guilherme, I see. Actually, I am doing the same kind of thing but I solved the problem slightly differently from you :). I created a custom widget that binds to a single value in the form, and contains the dynamic "sub-form." This way, I still get the benefit of the one-to-one mapping of abstract data to concrete form element, but also have the freedom to go crazy with the sub-form.
In my case, my sub-form has a selectbox list of concert presenters whose selection is bound to a selectbox of concert halls managed by the concert presenter. When the user chooses a hall, this populates the actual text description of the concert hall and its address. Only the text field is bound to the form controller. Hopefully, this idea is as useful to you as it was for me! Greg On May 29, 2010, at 10:57 AM, Guilherme Aiolfi <[email protected]> wrote: Greg, you are right. I went and look exactly what I was doing in my code and it's a little different of what I described earlier. The problem is when I have a field in the form that has no correspondent in the store's model. But it still an undesired behavior, IMO. I have a field in my form that is filled automatically depending on what is in other fields. That information is not fetch from the server and is generated by a client-side code. So the store doesn't have (and shouldn't have) that information. Playground example: http://tinyurl.com/2u6uavb On Sat, May 29, 2010 at 10:32 AM, Greg Beaver <[email protected]>wrote: > On 5/28/10 2:05 PM, Guilherme Aiolfi wrote: > > Hi, > > > > I'm trying to bind a store to a form controller. So all I need to do > > to load a record into a form is to set the right URL into the store > > and wait it to load. > > > > It works great. The problem is when I try to load some data that there > > is no correspondent in the controller. For example, > > > > let's say that the store is loading: > > > > {id: "1", name: "john", lastName: "doe"} > > > > and I'm binding with: > > > > store.bind("model", formController, "model"); > > > > For form with fields: "id", "name" and "lastName". It works. > > > > For form with just "id" and "name" fields, it doesn't work because it > > doesn't find "lastName" property in the formController to bind. > > > > What do I need to hack to make that bind a little bit clever and bind > > just when there is a target to bind. > > > > Remove properties from the store model is not an option because I'm > > reusing it in another form (1 store for 2+ different controllers). > Hi, > > This sounds like a bug in your code to me, I have 2 instances of what > you describe in my code (re-using a store with multiple controllers). > In my case, I have a tree controller used for a tree, and in a seperate > area a selectbox with a listcontroller bound to each of the depths of > the tree in a form. You should probably post your code in the bug report. > > Greg > > > ------------------------------------------------------------------------------ > > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > ------------------------------------------------------------------------------ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
