Orkut Gmail Calendar Documents Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Flex HorizontalList Dynamic Dataprovider Issue
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kalyani Tiwari  
View profile  
 More options Oct 26 2009, 1:11 pm
From: Kalyani Tiwari <kalyanialshi6...@gmail.com>
Date: Mon, 26 Oct 2009 00:41:40 -0700 (PDT)
Local: Mon, Oct 26 2009 1:11 pm
Subject: Re: Flex HorizontalList Dynamic Dataprovider Issue
Thanks, Anand, for the quick help.

As per your direction I have put

var rendererProducer:ClassFactory = new ClassFactory
(CustomHorizontalListRenderer);
                rendererProducer.properties = {width:hList.width/
2,height:hList.height*2};
                hList.itemRenderer = rendererProducer;

hList.dataProvider = hListDP;

and added hListDP.refresh(); on scroll event.

Now there is still the same problem with the component view when
columnCount >= 3.
Strangely, it behaves well when columnCount = 2 (rowCount = 1 in both
the cases).

The exact problem is some images from component view disappears when I
click on left or right arrow of the scroll, although dataprovider have
them at each and every pt. of time.

Waiting for your response. Thanks,

On Oct 26, 11:34 am, "<fx:AnandVardhan/>" <vardhanan...@gmail.com>
wrote:

> A little shift,
> put before the loop..
> var rendererProducer:ClassFactory = new ClassFactory
> (CustomHorizontalListRenderer);
>                 rendererProducer.properties = {width:hList.width/
> 2,height:hList.height*2};
>                 hList.itemRenderer = rendererProducer;

> hList.dataProvider = hListDP;
> and add
> hListDP.refresh();
>                 hList.invalidateDisplayList();

> HTH
> Anand

> On Oct 26, 11:28 am, Kalyani Tiwari <kalyanialshi6...@gmail.com>
> wrote:

> > Hi,

> > I have created a sample Flex application that uses HorizontalList
> > component.

> > Now when I use static dataprovider that is if data to display is
> > static the HorizontalList component is working but when I use dynamic
> > dataprovider component's scrolling doesn't work.

> > My code for the sample app is as under:

> > sampleHList.mxml

> > <?xml version="1.0"?>
> > <!-- Simple example to demonstrate the HorizontalList Control. -->
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

> >     <mx:Script>
> >         <![CDATA[
> >                 import mx.collections.ArrayCollection;

> >             [Bindable]
> >             [Embed(source="assets/album1.jpg")]
> >             public var phone1:Class;

> >             [Bindable]
> >             [Embed(source="assets/album2.jpg")]
> >             public var phone2:Class;

> >             [Bindable]
> >             [Embed(source="assets/album3.jpg")]
> >             public var phone3:Class;

> >             [Bindable]
> >             [Embed(source="assets/album4.jpg")]
> >             public var phone4:Class;

> >             private var hListDP:ArrayCollection;

> >                         private function initHList():void
> >                         {
> >                                 hListDP = new ArrayCollection();
> >                 var tempObj:Object;

> >                 for(var itemCtr:Number=0; itemCtr<4; itemCtr++)
> >                 {
> >                         tempObj = new Object();
> >                         tempObj.label = "";
> >                         tempObj.thumbnailImage = "http://www.somedomain.com/
> > flexApp/images/album"+[itemCtr+1]+".jpg";//url from feed
> >                         hListDP.addItem(tempObj);
> >                 }

> >                 hList.dataProvider = hListDP;
> >                 hList.invalidateDisplayList();

> >                 var rendererProducer:ClassFactory = new ClassFactory
> > (CustomHorizontalListRenderer);
> >                 rendererProducer.properties = {width:hList.width/
> > 2,height:hList.height*2};
> >                 hList.itemRenderer = rendererProducer;

> >                         }
> >        ]]>
> >     </mx:Script>

> >     <mx:Panel title="HorizontalList Control Example" height="75%"
> > width="75%"
> >         paddingTop="10" paddingBottom="10" paddingLeft="10"
> > paddingRight="10">

> >         <mx:Label width="100%" color="blue"
> >            text="A HorizontalList control displays items in a single
> > row."/>

> >         <mx:HorizontalList id="hList" height="125" columnCount="3"
> > columnWidth="125" creationComplete="initHList()">
> >             <!--<mx:dataProvider>
> >                 <mx:Array>
> >                     <mx:Object label="Nokia 6630" icon="{phone1}"/>
> >                     <mx:Object label="Nokia 6680" icon="{phone2}"/>
> >                     <mx:Object label="Nokia 7610" icon="{phone3}"/>
> >                     <mx:Object label="Nokia LGV" icon="{phone4}"/>
> >                 </mx:Array>
> >             </mx:dataProvider>-->
> >         </mx:HorizontalList>
> >         </mx:Panel>
> > </mx:Application>

> > And here is the code for custom ItemRenderer:

> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Canvas  name="CustomHorizontalListRenderer" xmlns:mx="http://www.adobe.com/2006/mxml" borderStyle="solid" >
> >         <mx:VBox horizontalAlign="center"  verticalAlign="middle">
> >                 <mx:Image source="{data.thumbnailImage}" horizontalAlign="center"
> > verticalAlign="middle"/>
> >     </mx:VBox>
> > </mx:Canvas>

> > Can anybody throw some light on this issue? Thanks,

> > Sincerely,
> > Kalyani R. Tiwari- Hide quoted text -

> - Show quoted text -


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google