0 Replies Latest reply on May 21, 2009 1:29 PM by TodLoch

    How to set up a label control from custom event handler?

    TodLoch Level 1


      Below I try to describe my problem:


      I have a single instance of MyClass (I use Cairngorm framework), with ArrayCollection as a variable, in which I would like to keep a couple addresses from database.

      Additionaly  I created a custom components with a list of people retrieved from database, with eventhandler  for a doubleclick event. After I doubleclick on some person, I create a custom event and dispatch it. In command class connected with this event I connect to the database and get full data about this person and a set of her addresses. This set of addresses I placed into ArrayCollection in my model variable. And now I have a problem, because one of this address (the birth place) I would like to display below the list with persons, in a Panel with a couple of label control, but .... I can't to bind label control to my model.addresses[???] because I don't know if this doubleclicked person has this birth address at all?

      I wonder if it is possible to set up label control in my custom components in time when I'm receiving the data from database in my custom event handler???


      One of the way to achieve this is to define a string var in my model and placed this special address in it, and then the label control to this variable, for instance {model.birthplace}, but this is only needed for a moment, I don't want to keep this address in extra variable in model, because I have already it in my ArrayCollection in model, so it would be a duplicate.


      I hope that you could understand me and my english :-)


      Best regards