I like the idea … especially as we could use this all over the place without having both “enabled=true” and “disabled=true” mixed in code.
Chris Am 03.01.17, 22:38 schrieb "Alex Harui" <aha...@adobe.com>: This is a great topic. Currently, lots of things in MXML are easy to declare and difficult or impossible to "un-declare". There is the includeIn/excludeFrom for states, but states are more or less one-dimensional and often the set of conditions each create their own dimension. In other words, you might have states for "login" and "normal", but it gets unwieldy when you have states like "normalButWithSomeOtherCondition". Depending on how often folks might need to do this, it might be cheaper if some beads supported some sort of enable/disable property so you could turn off their functionality instead of removing them from the strand. That's what the Button Disable bead does. This idea just popped into my head so it could be full of holes, but what if we introduced a ConditionalBead? It would wrap a bead and add/remove it from the host strand based on the condition. So instead of: <mdl:Button text="DISABLED" raised="true"> <mdl:beads> <mdl:Disabled/> </mdl:beads> </mdl:Button> It would look like: <mdl:Button text="DISABLED" raised="true"> <mdl:beads> <js:ConditionalBead if="{data.twitter == null}"> <mdl:Disabled/> </js:ConditionalBead> </mdl:beads> </mdl:Button> Thoughts? -Alex On 1/3/17, 11:58 AM, "piotrz" <piotrzarzyck...@gmail.com> wrote: >Sorry didn't understand fully. Well the only think which came up to my >mind >is use StrandUtils.loadBead in code. > >If condition occurs loadBead. > >Piotr > > > >----- >Apache Flex PMC >piotrzarzyck...@gmail.com >-- >View this message in context: >http://apache-flex-development.2333347.n4.nabble.com/FlexJS-How-to-set-bea >ds-based-on-a-condition-tp57798p57856.html >Sent from the Apache Flex Development mailing list archive at Nabble.com.