Can you set arraycollection objects to certain states?

hey guys.. so in my application, i need to setup rules and permissions for certain users...
so basically my applicaion initially displays a login screen, on login success its going to get a variable from the server which says if the user has all or video access
the way i have my "login success" component setup is i have an array collection and i have states
basically if the user has "all" access then the user shoudl be able to see everythign in that array collection. and if the user has "video" access the the user shoudl onlly see the video option in the list
the code i have is
     <fx:Declarations>
          <!-- Place non-visual elements (e.g., services, value objects) here -->
          <s:ArrayCollection id="webCoreSourceData">
               <fx:Object label="Content Group" stackId="contentGroup" />
               <fx:Object label="Images" stackId="images" />
               <fx:Object label="Image Renderer" stackId="imageRender" />
               <fx:Object label="Videos" stackId="videos" />
               <fx:Object label="Flash Objects" stackId="flashObjects" />
               <fx:Object label="Story Editor" stackId="storyEditor" />
               <fx:Object label="Tag Management" stackId="tagManagement" />
               <fx:Object label="Image and Video Format" stackId="format" />
               <fx:Object label="Rules And Permissions" stackId="rulesAndPermissions" />
          </s:ArrayCollection>
     </fx:Declarations>
     <s:states>
          <s:State name="all" />
          <s:State name="videoUpload" />
          <s:State name="imageUpload" />
          <s:State name="contentGroup" />
          <s:State name="flashObjects" />
     </s:states>
        <list dataprovider="webCoreSourceData" />
i need to set each one of these arraycollection objects to a certain state, so when i set "currentState=videoUpload" then only video displays in the list component
and when i set my "currentState="all"" then i want to be able to all the objects in the arraycollection
any help is greatly appretiated!! thank you...

Hi,
There are a few things you can do, one is to filter the array on change of state you could have it that your dataprovider is different for each state then you do something like below. This might give you some sort of direction anyway..
David
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
]]>
</fx:Script>
<s:states>
<s:State name="State1"/>
<s:State name="ImageState"/>
<s:State name="VideoState"/>
<s:State name="OtherState"/>
</s:states>
<fx:Declarations>
<s:ArrayCollection id="Videos">
<fx:Object label="Video1" />
<fx:Object label="Video2" />
<fx:Object label="Video3" />
<fx:Object label="Video4" />
</s:ArrayCollection>
<s:ArrayCollection id="Images">
<fx:Object label="Image1" />
<fx:Object label="Image2" />
<fx:Object label="Image3" />
<fx:Object label="Image4" />
</s:ArrayCollection>
<s:ArrayCollection id="OtherStuff">
<fx:Object label="OtherStuff1" />
<fx:Object label="OtherStuff2" />
<fx:Object label="OtherStuff3" />
<fx:Object label="OtherStuff4" />
</s:ArrayCollection>
<s:RadioButtonGroup id="radiogroup1"/>
</fx:Declarations>
<s:List id="myList" x="163" y="85" width="271" height="386"
dataProvider.VideoState="{Videos}"
dataProvider.ImageState="{Images}"
dataProvider.OtherState="{OtherStuff}"/>
<s:Button y="15" label="Video" x="160" click="currentState='VideoState'"/>
<s:Button y="15" label="Image" x="240" click="currentState='ImageState'"/>
<s:Button y="15" label="Other" x="320" click="currentState='OtherState'"/>
</s:Application>

Similar Messages

  • HT4113 Can you set a passcode to activate at certain times of the day, say at 930pm, and  turn off again the next morning?

    Can you set a passcode to activate at certain times of the day, say at 930pm, and  turn off again the next morning?

    No, sorry, you can't. The screen lock passcode is either on at all times or it's off.
    Regards.

  • Can you set a song to go on at a certain time like an alarm clock

    can you set your itunes to go off at a cetain time like an alarm clock?????

    Set the timer accordingly (tap to enlarge image)

  • Can you set up multiple user accounts on one laptop?

    can you set up multiple user accounts on one laptop?

    Of course.
    And instructions can depend on which OS X is installed.
    For v10.7 Lion > OS X Lion: Create a new user account
    For v10.8 Mountain Lion > OS X Mountain Lion: Create a new user account
    When you post for help, please state which OS X is installed.
    If you aren't sure, click About this Mac from your Apple menu 

  • Can you set the Duration of a Transition to instant? Or Remove a previous?

    Can you set the duration of a Transition to instant? (Rotate and Translate).
    Or if not, remove a previous transition done? (Reset the transitioned object back to its original). Ihave tried setting Duration.millus(.000001), but I can still see it translate/rotate. if I set it to zero, it doesn't do anything at all.
    Goal:
    I have a Connect4 type grid that Flips. It rotates upside down 180degrees, the pieces 'fall' down. Then I ACTUALLY flip the game board (not just effects) using a matrix calculation. But since my grid is upside down, my pieces appear upside down.
    So here is the method I was thinking:
    -Flip the board upside down
    -Translate the pieces down (gravity)
    -Actually flip the game board's internals and positions.
    -Undo the previous rotate/translate so the user thinks the 'animation' actually flipped the board.

    You cannot create an instant Transition. An Animation with a duration of 0ms is considered invalid and does not do anything when play() is called.
    Why do you have to use Transitions to set the values? They just modify Node properties over time, if you want to change the properties instantly, you can just access them directly. TranslateTransition modifies translateX, translateY, and translateZ, RotateTransition modifies rotate and rotationAxis.

  • Can you destroy an object?

    I have been looking around for an answer to this question a little while and have also posted on the Java .net forums too.
    But Im writing a little game where things appear on the screen, then because of user interaction, they dissapear. simple enough, I have my objects stored in a sequence, that I bind to a Group{} in my main Frame.
    The issue is that each of these objects get removed from the game via the *delete sequence* code segment and because they have their own timelines which does its own collision detection, the object never seems to get de-referenced and after a while I get out of memory exceptions and the game slows down to a halt.
    Firstly, I added functions to stop all timelines in each element before deleting it from the sequence, but it didnt appear to work as the game still slows down.
    So my question is, can you destroy an object? I just need it gone completly, and if there is a work-around, how can I be sure that it works? Currently the netbeans profiler isnt too easy to read, but that just maybe me (anyone else having issues reading the results of a JavaFX profiled app?)
    Thanks for any help that you can think of...
    Mark

    Are you 100% certain that there are no references to the object left after you remove it from the sequence? There is no way to explicitly destroy objects in Java; and this behavior extends to JavaFX. If you check the code and you're 100% sure that no references are left hanging out there, check Jira.
    [http://openjfx.java.sun.com/jira/|http://openjfx.java.sun.com/jira/]

  • Can you set up apple tv using 2 different itunes accounts from 2 different macs in same household?

    can you set up apple tv using 2 different itunes accounts from 2 different macs in same household?

    No, you can only connect to one Home Sharing account at a time. If you want to see the content of the other Mac's library you will have to turn off Home Sharing on the Apple TV and log back in with the other iTunes account.

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • How can you set up more than one device on iTunes. I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices.

    How can you set up more than one device on iTunes? I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices. I have all my music/videos on iTunes on my mac book pro. Can you set up separate folders for each device and drop in what ever music/videos from the main iTunes library?

    In itunes it is called syncing and you can choose exactly what content to sync to all devices and it can be different for all of them
    How to sync

  • Can you set up multiple Facebook users on 1 IPad 4?

    Can you set up multiple Facebook users(2) on one IPad 4?

    I think maybe on different users on one computer - but not on the same one.

  • Can you set up 2 iTunes accounts on one computer?

    Can you set up 2 iTunes accounts on one computer?

    I had two accounts on one computer until recently. You need to use two user accounts on the computer. Note, I say I did it until recently, therefore I'm not able to confirm this still works, but assume it does.

  • Can you set a second "Open with:" application for a file?

    Hi all,
    I was wondering if something like this exists for OS X Lion or greater: you can set a default application to open a type of file, say Safari for all .html files, but can you set a second default application for a file?
    I usually open files using command + o or command + down arrow from the Finder and I've often thought how good it would be to hit an alternate keyboard shortcut to open the selected file in a secondary default application.
    For example, if I'm making a web page and have the .html selected in the finder I can hit command + o (or command + down arrow) to open it in Safari and if the file isn't open in my editor and is selected in the Finder I can hit, say command + option + o (or command + option + down arrow) to open the .html file in my editor.
    Does anyone know if this can be achieved in OS X Lion or greater?
    Any advice is greatly appreciated.
    Thanks.

    Hi all,
    If anyone's interested in a partial solution, I've rigged up the following.
    I ended up using an Automator action coupled with Spark to capture a keyboard key combination. Spark: http://www.shadowlab.org/Software/spark
    I've used Spark before with good results, and although it's from 2008 it still works on Lion.
    I created an Automator action that does two things:
    gets the selected Finder items
    opens finder items in the text editor I'm using.
    I then saved the workflow as an application so that Spark could run it.
    I've set up a keyboard shortcut that Spark picks up and calls my Automator workflow. It all seems to work nicely.
    So, I've created a specific "open selected file with <text editor>" keyboard shortcut that should do for the time being.

  • Can you set a web page as a 'home page' on the i phone safari as you would?

    Can you set a home page or will the safari button always take you to the last web site you were on?

    You cannot set a Home Page in Safari but if you save your favorite bookmark to the home screen, you can use that to open the browser on iPhone.
    To do this:
    Open Safari and open the page you want for the "Home Page".
    Tap the "+" at the bottom of the screen and select "Save to Home Screen"
    You can then name it whatever you wish and tap Save.
    This will create an icon on the home screen that you can tap on to always open Safari to that page.

  • Can you set different colours for invitees in calendar?

    In calendar on the iphone/ipad can you set any events that you accept from invitees to a different colour so that you can instantly distinguish them from your own events?
    Cheers

    You could choose None in Preferences > General > New Mail Sound and set up a rule for each account in Preferences > Rules as follows:
    If [any/all] of the following conditions are met:
    [Account] [AccountName]
    Perform the following actions:
    [Play Sound] [Sound]
    Problem is, that would cause the sound to be played for junk mail as well — probably not what you want.

  • HT1677 Where can you set default in Safari to view as web page instead of Mobile Version?

    Where can you set the default setting in Safari to open page as web page instead of Mobile Version on iPad running iOS6.01?

    And, to make it even more fun, sometimes a website changes how it deals with Safari Mobile. A website that treated it like a desktop browser suddenly starts treating it like a cell phone. Just to mess with you. Or push an app.
    Best of luck.

Maybe you are looking for

  • Abobe acrobat reader 8.1.2 failed to install.

    My reader was working fine. Something happened when I tried to install latest 8.0 version. My reader stopped working and now I can't even open a PDF file. Every time I try to download and install the latest version (8.0) an error message comes up dur

  • Issue with re-skilling agents in bulk

    We tried to re-skill about 30 agents in bulk and change the competence level at the same time. Uccx took the change but, we noticed that agents were in a ready state even with calls were in the queue. We went back and one by one re-skilled them again

  • MBAM 2.5 FIPS Compliance Windows 7 SP1

    The only reference I can find with regards to FIPS and Windows 7 with MBAM is in the planning guide which says Supporting BitLocker Protectors -  Numerical password - applied automatically as part of volume encryption and does not need to be configur

  • How to transfer photos from iphoto 09 on iMac to iphoto on Mac Book Pro

    This is my first posting as I have tried unsuccessfully to find an answer to my query in the many answers to questions already posed. I have an iMac and recently my girlfriend bought a Mac Book Pro. Whilst I have managed to transfer my music library

  • HP 15-p189sa wireless driver for win 7 needed

    Hi folks I have a friends parent that got a new laptop and wanted win 7 not "that awful windows 8 thing" , she purchased a win7 home premium disk and i installed it and can get wired internet acces but just cant find a driver to make the wifi work. I