Hi Stefan,
Thank you for you reply. I, actually, came up with the same workaround as
you did. it's working fine but I thought I should mention the strange
behavior.
And regarding model.remove(), thank for the tip, I'll change my code ASAP.
Setting the model is unnecessary indeed, even though no error was throw
where I tested it: FF 3.6.3, WinXP. I'm not at work right now, so I'm not
sure about the FB version.
On Fri, Jun 4, 2010 at 6:17 PM, Stefan Volbers <[email protected]> wrote:
> Hi Guilherme,
>
> it looks like a bug to me, but I guess only Martin can tell for sure
> (maybe he will on monday).
>
> Nonetheless, if you remove the listItem directly from the list via
> list.remove(list.getSelection()[0]);
> the error does not occur.
>
> Speaking of which, the line
> controller.setModel(model.remove(selected));
> in your example throws a couple of errors in firebug here (FF 3.5.x, FB
> 1.4.y on WinXP) which don't happen if you just do
> model.remove(selected);
> but the problem you described remains...
> (can't explain why and was too lazy to read all FB's debugging output,
> but the controller does already have the model, so re-setting the model
> probably doesn't make sense).
>
> Maybe you can cope with the cheap workaround I offered for the time being,
>
> greetings,
> Stefan
>
> On 04.06.2010 19:47, Guilherme Aiolfi wrote:
> > Hi,
> >
> > take a look here (sorry for the length url, but none of the url
> > shortener was able to work with that url, they say it's invalid, but
> > works for me):
> >
> http://demo.qooxdoo.org/devel/playground/#%7B%22code%22%3A%20%22var%2520names%2520%253D%2520%255B%2522Max%2522%252C%2520%2522Jackob%2522%252C%2520%2522Tim%2522%252C%2520%2522Jack%2522%252C%2520%2522Dan%2522%252C%2520%2522Dustin%2522%252C%2520%2522Karl%2522%252C%2520%2522Jim%2522%255D%253B%250A%2520%2520%2520%2520%2520%2520var%2520emotes%2520%253D%2520%255B%2522embarrassed%2522%252C%2520%2522kiss%2522%252C%2520%2522plain%2522%252C%2520%2522sad%2522%252C%2520%2522surprise%2522%252C%2520%2522angel%2522%255D%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520the%2520data%250A%2520%2520%2520%2520%2520%2520var%2520rawData%2520%253D%2520%255B%255D%253B%250A%2520%2520%2520%2520%2520%2520for%2520(var%2520i%2520%253D%25200%253B%2520i%2520%253C%252020%253B%2520i%252B%252B)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520var%2520person%2520%253D%2520%257B%257D%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520person.name%2520%253D%2520names%255Bi%2520%2525%2520
>
> names.length%255D%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520person.emote%2520%253D%2520emotes%255Bi%2520%2525%2520emotes.length%255D%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520person.online%2520%253D%2520(i%2520%2525%25203%2520%253D%253D%25200)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520rawData.push(person)%253B%250A%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520var%2520data%2520%253D%2520qx.data.marshal.Json.createModel(rawData)%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520the%2520widgets%250A%2520%2520%2520%2520%2520%2520var%2520list%2520%253D%2520new%2520qx.ui.form.List()%253B%250A%2520%2520%2520%2520%2520%2520list.setWidth(150)%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520add%2520the%2520widgets%2520to%2520the%2520document%250A%2520%2520%2520%2520%2520%2520this.getRoot().add(list%252C%2520%257Bleft%253A%252010%252C%2520top%253A%252080%257D)%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%25
>
> 2F%2520create%2520the%2520options%2520for%2520the%2520icon%250A%2520%2520%2520%2520%2520%2520var%2520iconOptions%2520%253D%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520converter%253A%2520function(value)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520%2522icon%252F16%252Femotes%252Fface-%2522%2520%252B%2520value%2520%252B%2520%2522.png%2522%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%257D%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520the%2520controller%250A%2520%2520%2520%2520%2520%2520%252F%252F%25201.%2520Parameter%253A%2520The%2520data%2520as%2520a%2520qx.data.Array%250A%2520%2520%2520%2520%2520%2520%252F%252F%25202.%2520Parameter%253A%2520The%2520list%2520widget%250A%2520%2520%2520%2520%2520%2520%252F%252F%25203.%2520Parameter%253A%2520The%2520path%2520to%2520the%2520property%2520which%2520should%2520be%2520showed%2520in%2520the%2520label%250A%2520%2520%2520%2520%2520
>
> %2520var%2520controller%2520%253D%2520new%2520qx.data.controller.List(data%252C%2520list%252C%2520%2522name%2522)%253B%250A%2520%2520%2520%2520%2520%2520controller.setIconOptions(iconOptions)%253B%250A%2520%2520%2520%2520%2520%2520controller.setIconPath(%2522emote%2522)%253B%250A%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520the%2520options%2520for%2520the%2520online%2520binding%250A%2520%2520%2520%2520%2520%2520var%2520colorOptions%2520%253D%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520converter%2520%253A%2520function(data)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520if%2520(data)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520%2522green%2522%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%2520else%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520%2522red%2522%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520
>
> %2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%257D%253B%250A%250A%2520%2520%2520%2520%2520%2520%252F%252F%2520create%2520the%2520delegate%2520to%2520change%2520the%2520bindings%250A%2520%2520%2520%2520%2520%2520var%2520delegate%2520%253D%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520bindItem%2520%253A%2520function(controller%252C%2520item%252C%2520id)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520controller.bindDefaultProperties(item%252C%2520id)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%252F%252F%25201.%2520Parameter%253A%2520The%2520property%2520chain%2520to%2520the%2520data%2520source%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%252F%252F%25202.%2520Parameter%253A%2520the%2520property%2520name%2520to%2520in%2520the%2520target%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%252F%252F%25203.%2520Parameter%253A%2520the%2520options%2520for%2520the%2520binding%250A%2520%2520%2520%2520%2520%252
>
> 0%2520%2520%2520%2520%252F%252F%25204.%2520Parameter%253A%2520the%2520current%2520item%2520(comming%2520in%2520as%2520parameter)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%252F%252F%25205.%2520Parameter%253A%2520the%2520current%2520id%2520(comming%2520in%2520as%2520parameter)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520controller.bindProperty(%2522online%2522%252C%2520%2522textColor%2522%252C%2520colorOptions%252C%2520item%252C%2520id)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520controller.bindProperty(null%252C%2520%2522label%2522%252C%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520converter%253A%2520function(data)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520%2522---%2522%2520%252B%2520data.getName()%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520
>
> %2520%2520%2520%2520%2520%257D%252C%2520item%252C%2520id)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520%2520%2520controller.setDelegate(delegate)%253B%250A%250A%250A%2520%2520%2520%2520%2520%2520var%2520removeButton%2520%253D%2520new%2520qx.ui.form.Button(%2522Remove%2522)%253B%250A%2520%2520%2520%2520%2520%2520removeButton.setWidth(120)%253B%250A%2520%2520%2520%2520%2520%2520this.getRoot().add(removeButton%252C%2520%257Bleft%253A%2520180%252C%2520top%253A%252080%257D)%253B%250A%2520%2520%2520%2520%2520%2520removeButton.addListener(%2522execute%2522%252C%2520function()%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520var%2520selected%2520%253D%2520controller.getSelection().getItem(0)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520var%2520model%2520%253D%2520controller.getModel()%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520controller.setModel(model.remove(selected))%253B%250A%2520%2520%2
> 520%2520%2520%2520%257D%252C%2520this)%253B%250A%250A%250A%250A%250A%22%7D
> >
> > What to do?
> >
> > 1. Select "--- Tim";
> > 2. Click in "Remove"
> >
> > What is wrong?
> >
> > All items above the item removed have its label changed, seems that it
> > ignores that code:
> >
> >
> > *controller**.**bindProperty**(**null**, **"label"**, **{**
> > ** **converter**: **function**(**data**)**
> > ** **{**
> > ** **return **"---" **+ **data**.**getName**(**)**;**
> > ** **}**
> > ** **}**, **item**, **id**)**;*
> >
> >
> > Am I doing something wrong or it's a bug?
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel