Solved

Flex Databind to Lineseries

Posted on 2009-05-06
4
457 Views
Last Modified: 2012-05-06
I'm creating lineseries using below code
var myLineSeries:LineSeries = new LineSeries();
myLineSeries.visible = allSegmentChartsOn;

I want the visible should be driven from allSegmentChartsOn boolean which is bindiable variable.
defined as :
[Bindable] private var allSegmentChartsOn:Boolean=true;

is there anyway I need to do in order the visibility should be changed as we change allSegmentChartsOn  variable in the code?
[Bindable] private var allSegmentChartsOn:Boolean=true;
var myLineSeries:LineSeries = new LineSeries();
myLineSeries.visible = allSegmentChartsOn;

Open in new window

0
Comment
Question by:SimonHowald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:SimonHowald
ID: 24332994
any one?
0
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 24333586
private var allSegmentChartsOn:Boolean=true;

[Bindable]      
public function set segmentChartsOn(value:Boolean):void {
   allSegmentChartsOn = value;
}
public function get segmentChartsOn():Boolean {
   return allSegmentChartsOn;
}

var myLineSeries:LineSeries = new LineSeries();
myLineSeries.visible = allSegmentChartsOn;

>> is there anyway I need to do in order the visibility should be changed as we change allSegmentChartsOn  variable in the code?
// Yes. This line takes care of that:

BindingUtils.bindProperty(myLineSeries, "visible", this, "segmentChartsOn");

The above line adapts the "visible" property of myLineSeries whenever the "segmentChartsOn" property of 'this' changes.
0
 

Author Closing Comment

by:SimonHowald
ID: 31578862
You are a real Flex master!

Thanks!
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24349506
Thanx 4 axxepting
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question