Hi.

It should if I set dataProvider once and then just work with it using for
example addItem(...), removeItemAt(...), refresh(), etc.
But what if I set brand new dataProvider to List every time it is popped up.
However, even if i'd set dataProvider once and then just modified instances
of data in it like

for (var index : Number = 0; index < _popUp.dataProvider.length; index++) {
   _popUp.dataProvider[index] = false;
}

or in another way described effect remains the same.

At the moment the only obvious workaround is to
PopUpManager.createPopUpevery time instead of using existing one
through
PopUpManager.addPopUp.
But the solution and the reasons for this behavior still unclear.

R.

On 12/4/06, bhaq1972 <[EMAIL PROTECTED]> wrote:

  Hi Roman

shouldn't your dataprovider assignment be within the if test.

if (_popUp == null) {
_popUp = CheckList(PopUpManager.createPopUp(clickMe, CheckList));
_popUp.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
onMouseDownOutside);
PopUpManager.centerPopUp(_popUp);
var dataProvider : ArrayCollection = new ArrayCollection([
false, false, false, false,
false, false]);

_popUp.dataProvider = dataProvider;
}
else
{
PopUpManager.addPopUp(_popUp, clickMe);
}

regrds
bod

--- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Roman
Protsiuk"

<[EMAIL PROTECTED]> wrote:
>
> Hi, all.
>
> I've got some item renderers based on CheckBox. These item
renderers
> apper in a List wich is a pop up. Funny thing is when i select some
> check box, hide pop up, show it again and then reset that check
box to
> a selected = false; it looks like something between
checked/unchecked.
> Grayed like it's been disabled or something. It's selected property
> equals false. It behaves like it's unchecked but looks very
strange.
>
> Does anyone know what is going on with all this stuff?
>
> Here is some example for you to check:
>
> Item renderer CheckBoxItemRenderer.as:
>
> package src.itemRenderers {
>
> import mx.controls.CheckBox;
>
> public class CheckBoxItemRenderer extends CheckBox {
>
> public override function set data(value : Object) :
void {
> label = "select me"
> selected = value;
> super.data = value;
> }
>
> }
> }
>
> Pop Up based on List CheckList.mxml:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:List xmlns:mx="http://www.adobe.com/2006/mxml";
> itemRenderer="src.itemRenderers.CheckBoxItemRenderer"
> width="100"
> height="150">
>
> </mx:List>
>
> And the application itself testing.mxml:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute">
>
> <mx:Button id="clickMe"
> label="click me"
> horizontalCenter="0"
> verticalCenter="0"
> click="onButtonClick()" />
>
> <mx:Script>
> <![CDATA[
> import mx.events.FlexMouseEvent;
> import mx.collections.ArrayCollection;
> import src.CheckList;
> import mx.managers.PopUpManager;
>
> private var _popUp : CheckList;
>
> private function onButtonClick() : void {
> if (_popUp == null) {
> _popUp = CheckList
(PopUpManager.createPopUp(clickMe, CheckList));
> _popUp.addEventListener
(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
> onMouseDownOutside);
> PopUpManager.centerPopUp
(_popUp);
> } else {
> PopUpManager.addPopUp
(_popUp, clickMe);
> }
>
> var dataProvider : ArrayCollection =
new ArrayCollection([
> false, false, false, false,
false, false
> ]);
>
> _popUp.dataProvider = dataProvider;
> }
>
> private function onMouseDownOutside(event :
FlexMouseEvent) : void {
> PopUpManager.removePopUp(_popUp);
> }
>
> ]]>
> </mx:Script>
> </mx:Application>
>
> If anyone has some information regarding this situation please
share. :)
>
> Thanks in advance,
> R.
>

Reply via email to