flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From santanu4ver <santanu4...@gmail.com>
Subject Binding not works expectedly
Date Thu, 10 Mar 2016 11:23:43 GMT

I couldn't able to make this binding works in a component page (I followed
demo projects supplied within FlexJS SDK) when output as HTML. 

My InitialView.mxml uses <states> and I'm trying to inject a ValueObject
inside component in another state upon selecting a DataGrid item:

/<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
			 width="100%" height="100%" initComplete="onCreationCompletes(event)"
		<js:State name="LoginState" />
		<js:State name="DataState"/>
		<js:State name="DetailsState"/>
	<js:Container id="cData" 
			includeIn="DataState" width="100%" height="100%">
			<js:VerticalLayout />
		<js:DataGrid id="dataGrid" width="100%" height="100%"
className="MyDataGrid" rowHeight="60"
				<js:DataProviderChangeNotifier sourceID="applicationModel"
propertyName="dataList" />
						destinationPropertyName="dataProvider" />
				<js:DataGridColumn label="Partition Name" dataField="PartitionName" />
				<js:DataGridColumn label="Action Description"
				<js:DataGridColumn label="Action State" dataField="ActionState" />
				<js:DataGridColumn label="Action Start Time"
	<local:AgentChainDetails id="agentDetails" 
			includeIn="DetailsState" width="100%" height="100%"/>

Above, /onDataGridChangedEvent()/ injects the ValueObjects to
AgentChainDetails component after changing application state.

Following is my <fx:Script> section in AgentChainDetails:

/private var _selectedAgent:AgentChain;
public function get selectedAgent():AgentChain
	return _selectedAgent;
public function set selectedAgent(value:AgentChain):void
	if (value != _selectedAgent)
		_selectedAgent = value;
		dispatchEvent(new Event("selectedAgentChanged"));

While run as HTML, I manually edited 'js-debug/AgentChainDetails.as' and
added HTML alert in SET selectedAgent method, and I confirm SET
selectedAgent is calling by adding HTML alert with dummy texts. But the
alert never fires if I try something ValueObject.field - it looks like
'value:AgentChain' is coming empty

/Object.defineProperties(AgentChainDetails.prototype, /** @lends
{AgentChainDetails.prototype} */ {
/** @export */
selectedAgent: {
get: /** @this {AgentChainDetails} */ function() {
  return this._selectedAgent;
set: /** @this {AgentChainDetails} */ function(value) {
alert(value.ActionID); // ActionID is String field
  if (value != this._selectedAgent) {
    this._selectedAgent = value;

What I'm missing? Please help.

View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Binding-not-works-expectedly-tp12171.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

View raw message