[flexcoders] Re: How to make ViewStack Item Invisible
I did JUST what you suggested, but it is NOT showing up on the menu. Do I need some sort of refresh or ??? Thanks Bruce --- In flexcoders@yahoogroups.com, camlinaeizerous [EMAIL PROTECTED] wrote: It is already a separate component so take advantage of that and don't even add it to the view stack unless the user has access. This will also prevent the button form showing unless they have access. private function CallMeAfterUserValidation():void { if(UserCredentials.AllowedToAccesCustomers) { var temp:CustSearchForm = new CustSearchForm; myViewStack.addChild(temp); } }
[flexcoders] Re: How to make ViewStack Item Invisible
It will not be part of the view stack at all unless you want the user to be able to access it. Essentially until you add it it doesn't exist. When you do add the view with addChild() a button will be created automatically and the view will become accessible you shouldn't have to refresh anything. If the user has access to the view when they log on add it and it should appear if not it won't be there at all. If thats not the functionality your looking for then a different approach is needed. Something similar to the following may be more appropriate for your needs. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:views=views.* mx:Script ![CDATA[ [Bindable] private var HasAccess:Boolean = false; ]] /mx:Script mx:ButtonBar id=myBar dataProvider={viewstack1}/ mx:ViewStack x=10 y=30 id=viewstack1 width=200 height=200 views:viewone/ views:viewtwo id=viewtwo show=HasAccess ? viewtwo.visible = true : viewtwo.visible = false/ /mx:ViewStack mx:Button label={this.HasAccess ? 'Access' : 'No Access'} x=10 y=238 click=HasAccess ? HasAccess = false : HasAccess = true;/ /mx:Application
[flexcoders] Re: How to make ViewStack Item Invisible
It is already a separate component so take advantage of that and don't even add it to the view stack unless the user has access. This will also prevent the button form showing unless they have access. private function CallMeAfterUserValidation():void { if(UserCredentials.AllowedToAccesCustomers) { var temp:CustSearchForm = new CustSearchForm; myViewStack.addChild(temp); } } --- In flexcoders@yahoogroups.com, boy_trike [EMAIL PROTECTED] wrote: Following is a sample of my code: mx:ViewStack id=myViewStack width=100% height=100% y=15 mx:Canvas id=displayOrders label=My Orders comp:DisplayOrders id=myOrders / /mx:Canvas mx:Canvas id=displayItemSearch label=Item Search comp:SearchForm id=searchForm / mx:Canvas id=custSearchForm label=Customer Search comp:CustSearchForm id=custSearchForm / /mx:Canvas /mx:ViewStack The problem is that I want the CUSTOMER SEARCH (last canvas) to be invisible to certain people. I have tried visible = false and includeinlayout = false but neither works --- In flexcoders@yahoogroups.com, Dimitrios Gianninas dimitrios.gianninas@ wrote: Well a Viewstack by default only shows only one view at a time, so... perhaps you can post a sample of your code? But simply, use the visible property: myBox.visible = false; Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of boy_trike Sent: Monday, December 04, 2006 1:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to make ViewStack Item Invisible I have a viewstack with multiple canvas's below. Depending on a users credentials, I want some of the options to NOT be visible. I can set enabled to false and they are greyed out but I am not smart enough to figure out how to make them disappear (Out of sight, out of mind) thanks Bruce -- WARNING --- This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e-mail in error, please notify the sender. AVIS IMPORTANT -- Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur.
[flexcoders] Re: How to make ViewStack Item Invisible
would setting includeInLayout to false work? --- In flexcoders@yahoogroups.com, boy_trike [EMAIL PROTECTED] wrote: I have a viewstack with multiple canvas's below. Depending on a users credentials, I want some of the options to NOT be visible. I can set enabled to false and they are greyed out but I am not smart enough to figure out how to make them disappear (Out of sight, out of mind) thanks Bruce
[flexcoders] Re: How to make ViewStack Item Invisible
Following is a sample of my code: mx:ViewStack id=myViewStack width=100% height=100% y=15 mx:Canvas id=displayOrders label=My Orders comp:DisplayOrders id=myOrders / /mx:Canvas mx:Canvas id=displayItemSearch label=Item Search comp:SearchForm id=searchForm / mx:Canvas id=custSearchForm label=Customer Search comp:CustSearchForm id=custSearchForm / /mx:Canvas /mx:ViewStack The problem is that I want the CUSTOMER SEARCH (last canvas) to be invisible to certain people. I have tried visible = false and includeinlayout = false but neither works --- In flexcoders@yahoogroups.com, Dimitrios Gianninas [EMAIL PROTECTED] wrote: Well a Viewstack by default only shows only one view at a time, so... perhaps you can post a sample of your code? But simply, use the visible property: myBox.visible = false; Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of boy_trike Sent: Monday, December 04, 2006 1:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to make ViewStack Item Invisible I have a viewstack with multiple canvas's below. Depending on a users credentials, I want some of the options to NOT be visible. I can set enabled to false and they are greyed out but I am not smart enough to figure out how to make them disappear (Out of sight, out of mind) thanks Bruce -- WARNING --- This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e-mail in error, please notify the sender. AVIS IMPORTANT -- Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur.