Pfiuu... Problem solved :-) ! Just found that my children arrays where
converted to maps so, the _updateTreeChildren() didn't function correctly.



benco wrote:
> 
> Hi again!
> 
> I was wondering if the bindItem() function was called dynamically or if it
> was called only once after the model is attached to a controller...
> 
> I have a very specific model to handle for trees where childs and labels
> contain sometimes arrays of values... Here is a little example:
> 
> var model = 
> {
>       title:'root'
>       childs:
>       {
>               {
>                       title:'title1',
>                       language:'fr',
>                       childs: ...
>               },
>               {
>                       [
>                               {
>                                       title:'titre2-fr',
>                                       language:'fr'
>                               },
>                               {
>                                       title:'titre2-en',
>                                       language:'en'
>                               }
>                       ],
>                       childs: ...
>               }
>       }
> };
> 
> 
> In my bindItem function, I included a test on the id model:
> 
> if (typeof(id['getTitle'])!='undefined')
> {
>       controller.bindProperty("title", "label", null, item, id);
> } 
> else
> {
>       var props = id.basename.split('"');
>       for (var i=0, l=props.length; i<l; i++)
>       {
>               if (props[i]!='childs')
>               {
>                       if (id.get(props[i]).getLanguage()==currentLanguage) 
> break; //
> currentLanguage is defined outside of the function
>               }
>       }
>       
>       if (i>l) i=0;
>       
>       controller.bindProperty(props[i]+".title", "label", null, item, id);
> }
> 
> But it seems that the bindProperty isn't reaffected. I added some
> console.log() in order to check if first condition was retested but it
> seems to be done only once.
> 
> So... Maybe I've done some mistakes elsewhere in my code but my question
> is simply:
> 
> should this kind of bindItem() declaration work ?
> 
> Regards,
> 
> BenoƮt
> 

-- 
View this message in context: 
http://n2.nabble.com/Question-about-delegate-delegate-bindItem-and-controller-bindProperty-functions-tp4094402p4096107.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to