I updated the defaults.css in the HTML project to include the Image's model and view for SWF and JS and removed this code fragment. ―peter
On 9/12/16, 10:01 AM, "Peter Ent" <p...@adobe.com> wrote: >I had to go back and look into it all again. This code is necessary. The >source property is actually stored in the image's model. When this >property changes, the ImageView bead picks it up and sets it into the ><img> element, so the ImageView bead is also necessary; the Image needs >the view in order to detect and handle changes in the model. > >However, I think the real change should go into the defaults.css file. >Right now, the Image's model and view beads are set only for the Flash >side, which is why the JS side is explicitly creating them. If the >defaults.css were changed to be universal, then the code you see for the >JS side would not be needed. > >―peter > > > >On 9/12/16, 9:31 AM, "Peter Ent" <p...@adobe.com> wrote: > >>I'll have to see what happens when these lines are removed. The Flash >>side >>nearly always has model and view beads to build the components but the JS >>side may not have a view bead since the element (i.e., <img>) is the >>view. >>Meaning, the Flash and JS versions aren't always symmetric. I'm not >>really >>sure why the JS side would need a view. It may be that I was >>experimenting >>with making both sides always follow the same pattern and just checked in >>that code accidentally. >> >>Peter Ent >>Adobe Systems/Apache Flex Project >> >>On 9/12/16, 4:19 AM, "Harbs" <harbs.li...@gmail.com> wrote: >> >>>The Image component has the following code which did not make a lot of >>>sense to me considering it¹s JS-only: >>> >>> model = new >>> ImageModel(); >>> >>> addBead(new >>> ImageView()); >>> >>>When trying to figure this out, we realized that this should be >>>instantiated in UIBase in a more generic fashion. Are we correct in >>>assuming that this is legacy code and should be removed? >>> >>>Harbs >> >