Adobe Dreamweaver Forums



Last 10 THreads :         gesture driven scrolling list (Last Post : cntpmaxn - Replies : 64 - Views : 950 )           »          Formatting Text Paragraph (Last Post : BudHud - Replies : 0 - Views : 1 )           »          Tutorial Announcement :: Dynamic DropDwon Accordion Panel :: (Last Post : Günter_Schenk@adobeforums.com - Replies : 1 - Views : 2 )           »          Locking resize handles in browser. (Last Post : Jasper Thayer - Replies : 9 - Views : 10 )           »          Pushy div (Last Post : howeaver - Replies : 2 - Views : 3 )           »          adding a tag in replay history (Last Post : DynV - Replies : 6 - Views : 22 )           »          IE7 & CSS Opacity (Last Post : Al Sparber - PVII - Replies : 2 - Views : 3 )           »          file directory. (Last Post : lachy455 - Replies : 9 - Views : 10 )           »          Updating Templates (Last Post : Murray *ACE* - Replies : 3 - Views : 4 )           »          Re: Why can't Snit ever tell the truth? Is it a genetic problem? (Last Post : Steve Carroll - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:

Reply
  #1 (permalink)  
Old 07-24-2008, 01:56 PM
vikceo
 
Posts: n/a
Diggs:
Default Repeater conditional creating ui

Well i have a Array as a datasource say values {"A","B","C","D"}

using a repeater i want to create a ui with each value in the array as a label
element. this is pretty easy.

but, I want to do it on the basis of some condition like say if the value in
the array is "C' then i dont want to create a label for it..

any idea how to achieve this?

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2008, 03:45 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Repeater conditional creating ui


"vikceo" <webforumsuser@macromedia.com> wrote in message
news:g69vl8$9nk$1@forums.macromedia.com...
> Well i have a Array as a datasource say values {"A","B","C","D"}
>
> using a repeater i want to create a ui with each value in the array as a
> label
> element. this is pretty easy.
>
> but, I want to do it on the basis of some condition like say if the value
> in
> the array is "C' then i dont want to create a label for it..


Your question isn't very clear, but it sounds like you want to ignore C
completely.

If so, use an ArrayCollection instead and filter out C with a
filterFunction.

If that is not what you want to do, then just use something like this in the
label's visibility property within your itemRenderer file:

<mx: label visibility="{myProperty!='C'}" text = "{myProperty}" />

HTH;

Amy


Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 05:10 PM
Kaotic101
 
Posts: n/a
Diggs:
Default Re: Repeater conditional creating ui

If you set the label visibility based on 'C' it will still create a component
so say within a VBox you'll have a gap between the items. If this is not
desirable a better way be to go with either the filter function or create a
seperate dataProvider that has the items you don't want created already removed
and use that for a repeater. Your other option is to skip the repeater and use
straight AS 3 running a loop over your array. You can then check for C in your
loop and if it's true don't create a new component in your loop. It all depends
on your desired result of which one would be better to use.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 01:08 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk