Problem with getting specific canvas's to display within a viewstack based on button's clicked within a tilelist

In a new application I'm creating I've managed to set it up so that a user can add up to 5 'user profile buttons' by clicking an 'add item' button and remove each one by clicking an 'remove item' when they are selected.
That part works fine, however once each button is clicked it should bring up a specific canvas view within the viewstack relevant to that particular button i.e. when a user clicks the 'New Profile 1' button the 'New Profile 1' Canvas view should then be displayed in the viewstack, when they click 'New Profile 2' it should display 'New Profile 2' canvas in the viewstack etc but I am having trouble linking each specific button to 1 specific Viewstack canvas.
The problem is if, for example, I click the 'New Profile 2' button the 'New Profile 2' canvas IS displayed in the viewstack however if I then delete the selected 'New Profile 2' button the 'New Profile 3' button slides left into it's place but now clicking on New Profile 3 brings up the new profile 2 canvas whereas it should actually bring up the new profile 3 canvas at all times.
Eventually these canvas's will be personal areas for specific users so it is important that each button in the tilelist links to that specific user but it is also important that a user can add/delete each button at all times.
I've already had the first part of this problem (which was linking the tilelist to the viewstack) more or less answered but I clicked Correct answer rather than helpful answer in my previous thread. My mistake, sorry. Is ther a better way to do this application. Heres my code so far:-
<?xml version="1.0" encoding="utf-8"?>
 <mx:Application 
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="components.*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#545351, #E3DFDF]">
<mx:Script>
<![CDATA[
import mx.managers.*; 
private var _dragManager:DragManager; 
private var _historyManager:HistoryManager; 
private var _popupManager:PopUpManager; 
import flash.net.navigateToURL; 
import flash.net.URLRequest; 
import flash.net.URLVariables;  
import mx.events.ListEvent;  
import mx.controls.Button; 
import mx.collections.*; 
import mx.controls.Alert;]]>
</mx:Script>
<mx:Script>
<![CDATA[
import mx.effects.easing.Elastic; 
import mx.collections.ArrayCollection; 
Bindable] 
private var myDP:ArrayCollection = new ArrayCollection();
private var dpArr:Array = [{label:"New Profile 1", data:View1},{label:"New Profile 2", data:View2}, {label:"New Profile 3", data:View3},{label:"New Profile 4", data:View4}, {label:"New Profile 5", data:View5}]; 
private var addedIndices:ArrayCollection = new ArrayCollection(); 
private function deleteItem():void { 
if(myDP.length > 0){ 
for each(var i:int in tlist0.selectedIndices)myDP.removeItemAt(i);
private function addItem():void { 
if(myDP.length < dpArr.length && addedIndices.length < dpArr.length){ 
for(var a:uint = 0; a < dpArr.length; a++){ 
if(!addedIndices.contains(a) && !myDP.contains(dpArr[a])){myDP.addItemAt(dpArr[a],myDP.length);
break;}
private function tileList_itemClick(event:ListEvent):void { 
private function showAlert(event:ListEvent):void{ Alert.show(
"You clicked button #"+event.currentTarget.selectedItem.data);}
]]>
</mx:Script>
<mx:Sequence id="itemsChangeEffect1">
<mx:Blur blurYTo="12" blurXTo="12" duration="300" perElementOffset="150" filter="removeItem"/>
<mx:Parallel>
<mx:Move duration="750" easingFunction="{Elastic.easeOut}" perElementOffset="20"/>
<mx:RemoveItemAction startDelay="400" filter="removeItem"/>
<mx:AddItemAction startDelay="400" filter="addItem"/>
<mx:Blur startDelay="410" blurXFrom="18" blurYFrom="18" blurXTo="0" blurYTo="0" duration="300" filter="addItem"/>
</mx:Parallel>
</mx:Sequence>
<mx:Canvas width="1168" height="716" backgroundColor="#0219FB" horizontalCenter="0" verticalCenter="0" borderColor="#000000" borderStyle="solid" borderThickness="1" cornerRadius="20" backgroundAlpha="0.8">
<mx:Canvas id="UserArea" left="10" x="0" y="49" width="670" height="594" backgroundColor="#000000" cornerRadius="20" borderStyle="solid">
<mx:TileList id="tlist0" itemClick="myViewStack.selectedIndex=tlist0.selectedIndex" itemRenderer="mx.controls.Button" top="10" left="10" right="10" color="#FFFFFF" height="50" width="100%" fontSize="12" fontStyle="bold" columnCount="5" rowCount="2" direction="horizontal" dataProvider="{myDP}" itemsChangeEffect="{itemsChangeEffect1}" backgroundColor="#000000" fontWeight="bold" borderStyle="none"/>
<mx:Canvas x="63" y="129" width="200" height="200" fontSize="36" borderColor="#FFFFFF" id="Canvas1" visible="false">
<mx:Label x="27" y="25" text="Profile 1"/>
</mx:Canvas>
<mx:ViewStack x="115" y="88" id="myViewStack" width="382" height="317" backgroundColor="#F90C0C">
<mx:Canvas id="View1" label="View 1" width="100%" height="100%" backgroundColor="#0FDDE5">
<mx:Label x="10" y="10" text="NEW PROFILE 1" fontWeight="bold" fontSize="15"/>
</mx:Canvas>
<mx:Canvas id="View2" label="View 2" width="100%" height="100%" backgroundColor="#A90BCB">
<mx:Label x="10" y="10" text="NEW PROFILE 2" fontWeight="bold" fontSize="15"/>
</mx:Canvas>
<mx:Canvas id="View3" label="View 3" width="100%" height="100%" backgroundColor="#E6E413">
<mx:Label x="10" y="10" text="NEW PROFILE 3" fontWeight="bold" fontSize="15"/>
</mx:Canvas>
<mx:Canvas id="View4" label="View 4" width="100%" height="100%" backgroundColor="#F4A40A">
<mx:Label x="10" y="10" text="NEW PROFILE 4" fontWeight="bold" fontSize="15"/>
</mx:Canvas>
<mx:Canvas id="View5" label="View 5" width="100%" height="100%" backgroundColor="#0D1DFA">
<mx:Label x="10" y="10" text="NEW PROFILE 5" fontWeight="bold" fontSize="15" color="#FFFFFF"/>
</mx:Canvas>
</mx:ViewStack>
</mx:Canvas>
<mx:Button label="Remove item" click="deleteItem();" color="0x323232" x="96" y="10"/>
<mx:Button label="Add item" click="addItem();" color="0x323232" x="10" y="10"/>
</mx:Canvas>
 </mx:Application>

Hi
Try this if it works..
1. In MultiProvider identify those key figure from both the InfoProvider ( DSOs)
2. In BEx create KF1 . Restrict with 0INFOPROV = DSO1 ( Billing) , hide it
3. Create KF2 . Restrict with 0INFOPROV = Cube ( condition cube) , hide it
3. Create a Fomula Key Figure 3 with the definition
KF3 =  KF1 + KF2* ( KF1==0)
If KF1 is zero, then KF1 == 0  will be true and it will return value 1.  So, basically you would get
KF3 = 0 + KF2 *1 = KF2
When KF1 is non-zero, expression KF1== 0 will be false and gives a value 0. Let;s say KF1 =5 , then
KF3 = 5 + KF2 * 0 = 5
Now show KF3 in the report
Regards
Anindya

Similar Messages

  • Problem with getting resized image's bytes

    I've got a problem with getting correct bytes of a newly resized image. The flow is that I retrive an image from the filesystem. Due to the fact that it is large I resize it to a 50x50px thumbnail. I can display this thumbnail in #benchmark1 (see code below). Unfortunately something's wrong with my imageToBytes funtion which returns reasonably small size of image but is totally useless - I can't make an image of it anymore so at #benchmark2 the application either crashes or keeps freezing. I saved this byte array on my disk and tried to preview under Windows how does it look but I got a message "Preview unavailabe". I did some digging in the Internet and I supposed that it's because I don't use any jpg or png encoders to save the file. Actually I think that it's not the case, as the bytes returned from method imageToBytes look weird - I cannot even make a new image of them and display it without any saving in memory.
                                  byte[] bytes = FileHandler.readFile (
                                          FileHandler.PHOTOS_PATH, fileName);
                                  Image img2 = Image.createImage (bytes, 0, bytes.length);
                                  img2 = ImageHandler.getInstance ().resize (img2);
                                                    //#benchmark1
                                  bytes = ImageUtils.imageToBytes (img2);
                                  img2 = Image.createImage (bytes, 0, bytes.length);
                                                    //#benchmark2my imageToBytes function is as follows:
         public static byte[] imageToBytes (Image img)
              int[] imgRgbData = new int[img.getWidth () * img.getHeight ()];
              byte[] imageData = null;
              try
                   img.getRGB (imgRgbData, 0, img.getWidth (), 0, 0, img.getWidth (),
                           img.getHeight ());
              catch (Exception e)
              ByteArrayOutputStream baos = new ByteArrayOutputStream ();
              DataOutputStream dos = new DataOutputStream (baos);
              try
                   for (int i = 0; i < imgRgbData.length; i++)
                        dos.writeInt (imgRgbData);
                   imageData = baos.toByteArray ();
                   baos.close ();
                   dos.close ();
              catch (Exception e)
              return imageData;
    I've run totally out of any idea what's wrong, please help!
    Edited by: crawlie on Jul 17, 2010 6:21 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hey Crawlie,
    Please note that simply writing int values into ByteArrayOutputStream will not suffice. Please have a look at the following conversion from int pixel value into byte[4]:
    public static final byte[] intToByteArray(int value) {
            return new byte[] {
                    (byte)(value >>> 24),
                    (byte)(value >>> 16),
                    (byte)(value >>> 8),
                    (byte)value
    }Good Luck!
    Daniel

  • Hi, I have a problem with getting my apple Id working for me. It's been 2 months since it happened and Apple failed to act. I can tell my story proerly, but am not sure, you guys can help, so I just copy my message to them today, I am trying to get it acr

    Hi, I have a problem with getting my apple Id working for me. It's been 2 months since it happened and Apple failed to act. I can tell my story proerly, but am not sure, you guys can help, so I just copy my message to them today, I am trying to get it across all the places around to pay their attention. This is a desperate move, so if you are not the right people to help me to get my message accross, may be you can advise where can I go.
    Thank you, and sorry for the language.
    Vitas Dijokas
    I am sorry to say that, but your security makes my life miserable – it’s been 2 months since my Apple ID account got stuck, and since then I cannot update 37 applications (to date), i.e. most of my applications. Half of them I bought. I also paid for iCloud, and it is not working. I paid money and I am stuck with old applications and no iCloud. Your security *****. Your service ***** too. It took your service 1 month to finally understand why this happened to me, and it took me tens of emails to you and 3 hours of telephone conversation to find out the reason for my problem. And the problem is still not fixed. NOT FIXED. You just leave your customer – the one who paid you money and spent so much time with you trying to help you help me – and nothing. You tell me:  “Vitas, Stick your stinky iphone in your *** and enjoy life, we do not care!” *************.
    It is ******* outrageous, and you should know that,  guys. Get into the ******* database and correct the bug. Get someone in the partners-telephone carriers company (it is Orange as carreer and Cellcom as seller of the phone)  authorized to Identify me in personal encounter in one of the branches in Israel (where I live) and make sure it is really me, and get the ******* system accept my password and let me use my phone.
    Otherwise **** off. None of my friends will get my advise to buy an iphone or any of apple products. And I think you should be very attentive to cases like this, guys. Do your work for the money we pay, or disappear. There are many others eager to take your place, and if the problem is not fixed I will eventually go to the others. My patience is lost, and as soon as I can afford another phone I will change it. AND I WILL TRY TO GIVE BAAAAAD PUBLICITY TO APPLE – I am threatening here, so ACT NOW.
    Vitas Dijokas

    Well, it seems waiting is not my strong suit..! I renamed a javascript file called recovery to sessionstore. This file was in the folder sessionstore-backups I had copied from mozilla 3 days ago, when my tabs were still in place. I replaced the sessionstore in mozilla's default folder with the renamed file and then started mozilla. And the tabs reappeared as they were 3 days ago!
    So there goes the tab problem. But again when I started mozilla the window saying "a script has stopped responding" appeared, this time the script being: chrome//browser/contenttabbrowser.xml2542
    If someone knows how to fix this and make firefox launch normally, please reply! Thank you

  • Just moved my email from entourage to Mail. Having real problems with getting my signatures to work properly. When adding in a small company logo, windows computers only receive signature as an attachment. Am sending email as Rich Text. Any ideas on a fix

    Just moved my email from Entourage to Mail. Having real problems with getting my signatures to work properly despite sending email as Rich Text.
    When adding in a small company logo to the signature, PC's / windows computers only receive signature and logo as attachments.
    I've tried all possible fixes I can find including getting a PC user to format the logo but no joy. Has anyone experienced this and any ideas on a fix gratefully received.

    Send it as html so the signature is an image source URL

  • Problems with getting my Ipod Touch to work on my Sony Bravia or any TV

    I am having problems with getting videos or movies to play on my Sony Bravia HDTV or any TV. I have a first generation Ipod Touch and I have the Apple AV Composite Cables and all I get is sound for both TV's that I tried. I read one post where some guy had a faulty Ipod that wouldn't work. Does anyone know how of something hidden or special that needs to be done or how did they fix the problem if they had the same one? Thank, ejcarlson

    Check connection, if you have a case on your Ipod the connection may not be good enough.

  • Problem with getting iPod to work.

    I'm having a problem with getting an iPod to connect to my computers. Also I can't even really get it to run. My brother gave it to me one or two years ago and it had these problems I just didn't think of the idea of going directly to Apple to figure it out. It's a 30 GB black iPod if that helps. When I plugged it in it showed the battery symbol. When I leave it for a while it shows the Apple symbol. Then it comes up with this: http://spirrwell.webatu.com/ipod.jpg If you can help thanks in advance!
    Message was edited by: Spirrwell

    I figured out that it was a hard drive problem so I'll find a fix if not I guess I'm screwed.

  • I am not able to download ITunes. I had some problems with ITunes and had to uninstall but now when I reinstall iTunes after I click on download iTunes and save the File, I get this message"Thank you for downloading iTunes" and nothing else happens. I don

    I had some problems with ITunes and had to uninstall but now when I reinstall iTunes after I click on download iTunes and save the File, I get this message"Thank you for downloading iTunes" and nothing else happens. I don't see any thing else. Now not sure what else I have to do.
    Thanks,
    Ranjit

    See the further information area of Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Problem with getting the little blackberry icon

    Hi the blackberry I'm using is working and up to date. I was setting up my mates blackberry 9320 but having a problem with getting the little blackberry icon to appear in the top right corner of my phone where the GMS is and signal bar and stuff its something to do with blackberry.
    I tried downloading bbm and it say associating bbm with blackberry id and constant loads with nothing happening bbm not working
    I NEED THE TINY BB ICON AT TOP RIGHT???

    Hi neal123
                            That BlackBerry icon will appear near signal bar when we activate  BIS on a 3G device. Did he activated BIS on his account. ? 
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Can anyone help me with getting the iframe widget to display the url properly?

    Can anyone help me with getting the iframe widget to display the url properly?

    Please elaborate more as what exactly you are referring to, which iframe widget ? also by url do you mean page url where you are using iframe ?
    Thanks,
    Sanjit

  • TS2755 I am having a problem with getting notified when I receive a call or a text.  My phone will not ring or vibrate.

    I am having a problem with getting notified when I receive a call or a text.

    Hi BigBroMAC,
    The first thing I would check is Do Not Disturb mode, as this will cause that behavior:
    iOS 6: Using Do Not Disturb
    http://support.apple.com/kb/HT5463
    If that isn't the issue, this article has slightly different symptoms but the troubleshooting would be the same:
    iPhone: Can't hear through the receiver or speakers
    http://support.apple.com/kb/TS1630
    Before you do step 10, however, I recommend resetting all settings to see if that helps.  To do that, choose Settings > General > Reset > Reset All Settings.
    I hope this helps!
    - Ari

  • I still have problems with getting my website online. I have defined my server. Then I did the test and there was a connection via FTP. I put my files on the external server and there is a connection with the external server. But when I check to see my we

    I still have problems with getting my website online. I have defined my server. Then I did the test and there was a connection via FTP. I put my files on the external server and there is a connection with the external server. But when I check to see my website online (with Firefox, Explorer, Chrome browser) I always get the message 'Forbidden, You don't have permission to access / on this server.' Can somebody help me please? I have to get my website online..Thank you!

    Hello Els,
    it's well known, that in all these cases you describe I'm not a friend of a detailed Troubleshooting (I see Nancy#s smile already).
    To be able to be independent in all this things It is one of the reasons why I prefer an external FTP program. The difficulties with which you have to fight encourage me in this opinion, not least because we always search for experts, we don't charge a "jack of all trades".
    To manage several websites or to upload my files and sometimes for the opposite way, for a necessary download from my server or to use a "a site-wide synch", I'm using FileZilla. It simply looks easier for me to keep track of all operations precisely and generate or reflect easily the desired tree structure.
    Above all, FileZilla has a feature (translation from my German FileZilla) called "compare file list". Here it's possible to use file size or modification time as a criterion. There is also the possibility to "hide identical files", so that only these files which you want to redact remain visible.
    And even if it means you have to install a new program, I am convinced that there is an advantage. Here is the link to get it and where you can read informations about how it works:
    http://filezilla-project.org/ and http://wiki.filezilla-project.org/Tutorial#Using_the_site_manager
    Mac: Mac OS X (Use: Show additional download options)
    http://filezilla-project.org/download.php
    Of course, you also need all the access data to reach your server and for MIME issues, you should contact your web host/provider.
    Good luck!
    Hans-Günter
    P.S.
    Since I use two screens, the whole thing became even more comfortable.

  • Problem with language specific characters on e-mail sending

    Hi,
    Problem with language specific characters on e-mail sending.
    How can it be fixed?
    Thanks.

    Hi,
    try to work on the charecter code set UTF-8 or UTF-16. You can define this in html.
    Or encode the charecter using java script.
    Hope this may help you.
    Deepak!!!

  • Apple tv is giving me a meesage that says... There is a billing problem with a previous purchase. Go to the iTunes Store on your computer and click Purchase History to resolve problem. I have gone to my purchase history but can't seem to fix this issue.

    Apple tv is giving me a meesage that says... There is a billing problem with a previous purchase. Go to the iTunes Store on your computer and click Purchase History to resolve problem. I have gone to my purchase history but can't seem to fix this issue.

    You can contact the iTunes Store Customer Service department at no charge using the form on their Support page (select the category and subcategory closest to the issue you're reporting and you'll find an "Email Us" button) and explain your problem to them.
    Copied from Varjak Paw in :https://discussions.apple.com/thread/2598671

  • Problem with getting specified pages for printing

    requested Sir,
    I am sanjeev, presently working with adobe indesign for publishing.
    i am working verious sets of master pages,
    now have a problem go gate specific pages for print in the same software.
    it shows saction name that i could not inditify
    give me the message
    (one or more of th pages specified are not valid page name)
    so how gate the valid name of pages?
    please slove my problem,
    thanks
    sanjeev

    If your document has more than one section (sections are used to restart page numbering and similar tasks) you can identify the pages using either the logical name, which uses the section prefix and the "logical' page number which is the number that appears in the page marker, or you can use the absolute page number, which is the position in the document. You can set your preferences to display section or absolute page numbering in the Pages panel, too.
    Unless you assigne some other prefix, sections are labeled as Section I, Section II and so on, and pages are designated by Section:Page# in the dialogs. If you want to use absolute page numbering in the dialog instead, you can add a + sign in front of the page number in the dialog: +6-+12 will be the sixth though twelf pages in your document, even if they are in different sections and carry the numbers vi - 4, for example.

  • Importing Problem with one specific CD

    I have previously imported this disc. It is disc 2 of a 2 disc set. I have no problem getting iTunes to recognize the other disc in the set. Now after clearing all previous info and files related to this CD I cannot get iTunes to import it. The iTunes program itself frezes whenever I insert this disc. The rest of my programs are not affected.
    I have tried all of the obvious possibilties contained in the iTunes help file as well as the possible settings changes that affect importing CD's.
    The program stays frozen until I restart my computer.
    I am storing my music files in an external drive. That has presented no problem for this specific disc on a previous import and has not caused any trouble for the other disc copied. However once this freeze occurs and I restart my computer the primary library settings are changed from external drive storage back to the C drive storage.
    Weird huh?? Anyone have a similar experience??

    I have been able to play the CD in all the other players around the house including the media player in my older computer(ME / OS.) The OS CD player in the computer I use for my iTunes library recognizes the disk as well. iTunes previously imported this disk at least twice. I removed those copies and re-entered the disk a third time. The reason for the multiple entries was info mistakes and a few glitches learning how to set up the external storage.
    There is nothing wrong with the disk, it is not a burned disk and has not been exposed to anything that would alter the info on it.
    The problem is iTunes software related, perhaps the previous files are still lurking somewhere that I'm unable to access and this prevents the disk from being copied yet again.

Maybe you are looking for