Actionscript 3 :: Prevent Data Binding In Flex Datagrid?

Apr 12, 2012

I have two Datagrid in flex. I am binding data from Datagrid1 to Datagrid2 like

(Datagrid2.dataProvider=Datagrid1.dataProvider as ArrayCollection;)

If I delete Datagrid2 data then automatically another Datagrid1 deleted .

So I don't want delete data in Datagrid1 . how can i do that , But I have other option for delete data to Datagrid1?

View 2 Replies


Similar Posts:


Flex :: Data Binding - Datagrid Sorting Not Preserved Across Dataprovider Changes?

Aug 26, 2009

I have a flex datagrid. it is bound to an array collection. if the user sorts on column X it works fine. then, if the user causes the array collection to change, the datagrid forgets that it was sorted on column X.what do I need to do to preserve this sort preference so that the new array data will appear sorted by column X?

View 4 Replies

Actionscript 3 :: Prevent Displaying Of Some Data In Last Row Of Flex Datagrid?

Jan 6, 2010

I have some DataGrid with editable rows, which has also an option to add new row 'dynamically'. I mean, last row has some default data (e.g. "CLICK HERE TO ADD NEW ROW") and when user clicks on it, he can edit that value and new row will be eventually inserted.

However, I also have a column in same DataGrid which doesn't come from DataGrid's DataProvider. That column is used to delete specific row and it should only display clickable image with associated mouse click action (within custom itemRenderer).

[Code]...

View 1 Replies

Flex :: Binding ArrayCollection Result To DataGrid

Jun 29, 2010

I am trying to bind an ArrayCollection result coming in from the server to my DataGrid
created dynamically in AS. The result data is not getting Displayed in the Grid.
var dg:DataGrid = new DataGrid();
dg.width=650;
dg.dataProvider=someArrayCollfromServer;

I am adding the dgColumn as runtime based on some data from a XML and it is the same as defined in below static format. But if I use the same code and create the DataGrid as a Flex Component as below, it works fine.
<mx:DataGrid id="dg" width="100%" height="100%" dataProvider="{someArrayCollfromServer}">
<mx:columns>
<mx:DataGridColumn dataField="Value" headerText="Value"/>
<mx:DataGridColumn dataField="Code" headerText="Code" />
</mx:columns>
</mx:DataGrid>

This works fine. Is there some functionality or implementation different as far as DataGrid is concerned in Flex and AS.

View 1 Replies

Flex :: Binding Sum Of Column Of A Datagrid To A Formitem's Text?

Apr 21, 2011

I want to bind sum of a column of a datagrid to a FormItem'text which is shown below of that datagrid.

View 1 Replies

Flex :: Data Binding Re-bind When Data Model Not Change, Possible?

Nov 4, 2011

If user change the value of the TextInput, then click refresh button to retrieve the data model from backend again, the GUI value will not change back. Re-binding not happen, Since the value of data model not changed, no propertyChanged event fired.In this case, I must Programmatically set the model value to the GUI after data refreshing done.I know bi-directional binding can solve this problem(when user change value on GUI, set the new value to data model immediately). But sometimes I cannot use bi-directional binding, for example, the data model is a int, but user input a non-int value, I cannot set the value to data model. So the value in data model do not change, when refresh data, rebinding still not happen.

This will make the data binding useless. How to resolve this?I put pseudo-code here for now, I will put real code later:1. retrieve a data model from server, via blazeds or something else.2. bind the model to a TextInput on GUI.3. user change the TextInput text.4. User click a refresh button, triger retrieve the model value again.5. Now since the model value do not change, no PropertyChanged event fired.6. GUI value still is the user's input, not the value from the model. can clear the model value before set the velue back, make re-binding happen.(but sometimes you do not know how to clean the model value, take int for example, you may do not know the original value and happen set the same value). Or I can manually set the model value to GUI. But both are not good looking.

View 3 Replies

Flex :: Prevent Tab From Changing To Other Cell In Datagrid?

Jun 27, 2010

I have a flex editable datagrid mx:DataGrid and when I press TAB key, it changes to another cell when I am editing a cell.

I don't want it to change to another cell when I press TAB. How can I stop this behavior?

View 1 Replies

Flex :: DataGrid Prevent A Filter From Being Applied Automatically?

Jan 4, 2011

To situate things I am working on a translation utility with a datagrid having 3 columns : translation code, reference text and target text.

The DataGrid's dataProvider property is bound to an ArrayCollection instance. The user can edit the grid and on a successful edit, the underlying collection is updated using the setItemAt() method. The collection also has a filter function to make it easier to find certain texts.

When the user clicks the 'apply filter' button the filter function is updated. This works well. The problem I have is that rows are hidden as soon as the underlying collection item change in a way that doesn't comply with the filter. The row is hidden immediately, which is not very user friendly. Rows should only hide (or be shown) when the 'apply filter' button is pressed.

View 2 Replies

Flex :: Prevent Datagrid From Editing After A Drag & Drop

Feb 23, 2012

I have an AdvancedDataGrid with editable parameter to "true". My problem is that after a successfull drag & drop, the item is being edited and I don't want this to happen. I tried to create a custom advancedDataGrid with this:

[Code]...

View 1 Replies

Flex :: Conditional Data Binding?

Oct 8, 2009

first one shows playheadtime of videodisplay and another is also used for same purpose. the difference is that when we are in add mode(decided from a flag variable) both should show current playheadtime using binding. but when we are in edit mode(again decided from flag) the latter label should remain static, to be more specific, the value retrived from database.how can I do that using actionscript. I tried ChangeWathcer but I found it a bit tricky. Is there any other simpler way or am I missing something. following is my code.

private function init():void
{
if (queFlag == 'a')

[code].....

View 2 Replies

Flex :: Data Binding Not Working

May 3, 2010

I'm having some troubles with binding data. I have an application that contains a viewstack of components. Let's say I have comp1, comp2 and comp3 inside the viewstack. Each component, has its own data class --> comp1Data.as, comp2Data.as and comp3Data.as. All values in each component are binded to the corresponding data in it's data object.

A click in a control in comp1 leads to comp3, the same goes for comp2. Clicking a control in comp2 leads to comp3. When going from comp1 to comp3, comp3Data.as is initialized and and comp3 displays the binded values. When going from comp2 to comp3, comp3Data.as is also initialized but the binded values are not displayed...

[Code]...

View 1 Replies

Flex :: Dependencies In Data Binding

Aug 20, 2010

I'd like to add a derived property to flex:[code]However, derived won't update when I change a or b.Is there a better (faster) way to make derived update than giving a and b setter methods which invalidate it?added keyword "get".This makes more sense now, I hope.

View 3 Replies

Flex :: Create A Bidirectional Data Binding In 3?

Nov 23, 2009

I need to bind a property to an edit control and have the control write its value back to the same property. The problem is, I'm setting the source value before the control is created:

<mx:Panel>
<mx:Script>
<![CDATA[
[Bindable] public var editedDocument: XML;

[code].....

View 6 Replies

Flex :: Data Binding With A Value Inside A Component ?

Mar 30, 2010

I'm using Flex with Cairngorm framework.I have a custom component which I create like this:

<components:FriendSearchPaginator id="searchResultsPaginator"
paginationElement="{_model.findFriendsPaginationElement}"
visible="{_model.friendsSearchResultsPaginatorVisible}" />

Where the findFriendsPaginationElement is inside the model locator:

public var
[Bindable]
findFriendsPaginationElement:PaginationElement = new PaginationElement();

Inside the custom component I have button that uses a property of findFriendsPaginationElement object:

<s:Button id="previousButton"
label=" prev "
click="paginateSearchResults(false)"
enabled="{_model.findFriendsPaginationElement.more_previous}"/>

But I get a warning from Flex that the binding wouldn't work that way and it doesn't. It works the first time I load up the component but every time I change findFriendsPaginationElement it doesn't reflect on the component. Do you know how I can go about doing this? (making changing a value in the binding variable changes the status of an element inside a component?)

View 1 Replies

Flex :: Two Way Data Binding In AS Causes Stack Overflow

Jul 21, 2010

I'm binding two AutoCompleteModified objects to one another; meaning you type in one and it selects the correct object in the other. It works fine when I define it in MXML: However, a user can add a new row to a Grid and then I set up the binding and objects via actionscript and it gives an 'undefined' error:
ChangeWatcher line 427/wrapHandler.

var innerHBox:HBox = new HBox();
var dtc_acm:AutoCompleteModified = new AutoCompleteModified();
dtc_acm.dataProvider = data2;
dtc_acm.labelField = 'id';
var cp_acm:AutoCompleteModified = new AutoCompleteModified();
[Code] .....

If I only keep it 1-way binding then it works fine. But both throw this error. Is there something about not only doing it 2-way in actionscript, but adding components that aren't on the stage yet?

View 2 Replies

Flex :: Does Data Binding Work With The UITextField

Oct 1, 2010

Does data binding work with the UITextField? Unfortunately, I'm getting the variable instead of the bound data.

[Bindable]
public var myString:String;

in a function, where tf is a UITextField:

myString = "blah blah blah";
blah blah...
tf.text="{myString}";

It's giving me {myString} instead of its data.

View 1 Replies

Flex :: Data Binding - ComboBox And XML List

Mar 19, 2011

I have a bit of a problem (since I'm not used to binding with AS3), the thing is that I want to do this kind of data binding:

<mx:Application xmlns:mx="[URL]"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
[Code] .....

But the ComboBoxes are being created dynamically with AS3, everything is working except I cant bind the second ComboBox dataProvider to be the XMLList in the first ComboBox's selectedItem.

View 3 Replies

Flex :: Data Binding - How To Adjust ComboBox Width

Sep 15, 2009

In Flex 3, I've created a ComboBox within an MXML component similar to the following:

<mx:ComboBox id="comboBox" dataProvider="{_choices}" />
<mx:Script> <![CDATA[
import mx.collections.ArrayCollection;
// etc...
public function get choices():ArrayCollection { return _choices; }
[Code] .....

In the parent MXML application, I'm modifying the contents of the choices property:
myComponentId.choices.removeAll();
myComponentId.choices.addItem({data: "NY", label: "New York"});
myComponentId.choices.addItem({data: "CA", label: "California"});
// etc...

The binding is working in that the ComboBox is automatically picking up the new contents added at runtime, however it is not adjusting its width. The initial width of the ComboBox is wide enough only to show the initial item "All" declared in the component. However, I want and would have expected the ComboBox to re-size automatically during binding to be able to show "California", but it isn't. How can I get the ComboBox to update its width after I have added new wider labels to its dataProvider?

View 4 Replies

Flex :: Update An Image Dynamically Using Data Binding?

Feb 20, 2010

I have a main.mxml application that lays out my application, it contains a "browse and upload" button. And contains an image to view the users uploaded image like so:

<mx:Application
<mx:Script>
<![CDATA[

[Code].....

In my myModel class I have a img_scld_bm that the browseAndUpload() function draws into after scaling it.

My intent is that my mx:Image will display the image. As shown here I'm assigning the image source="mymodel.img_scld_bm", this ends up just showing a broken image icon.

I also tried data binding, where in my myModel class I have [Bindable] var img_scld_bm. And then tried setting my mx:Image source="{myModel.img_scld_bm}" .. that didn't seem to do anything either. All this compiles fine, no warnings. I think in this case, I'm not setting a trigger or propertyChange event to update the binding?

how to correctly bind an mx:Image source to some bitmap?

View 1 Replies

Actionscript 3 :: Flex Data Binding Through A Refenced Property?

Jun 8, 2011

class A: with a property "data:ArrayCollection". It's my data source (data provider) and has bitmaps.

class B: has an instance of A (called "Ainst") and calls the following method: C.init( Ainst.data). To pass the data provider to Object C.

class C: has a reference of the data provider "data" (because of "init" method). It shows the arrayCollection into Images as: Image.source = data.getItemAt(0).

But C never updates its images, that is, data binding doesn't work with this scheme. I've put [Bindable] meta-tag in all properties and even classes.

[Code]...

View 2 Replies

Flex :: Setting SelectedColor Of ColorPikcer When Binding Data

Jul 5, 2011

How do you set the selectedColor of a colorpicker when you bind data from a database? I have a bindable variable, objProject, with a field called color and it has a color code such as #ff00ff in it. I want to set the selectedColor. I tried to cast the color as a uint, but no joy.

objProject = cmbProject.selectedItem;
c = uint(objProject.color);
<mx:ColorPicker id="graphColor" x="17" y="219" width="128" height="40"
selectedColor="{c}" editable="true" />
I did try selectedColor="{objProject.color}" and that didn't work either.

View 2 Replies

Flex :: Binding Data From Webservice To Custom Component?

Jul 27, 2011

i'm using flash builder 4..i want to ask something..how to binding data to custom list component in flex??...i already try binding data from webservice to standard datagrid component in flex, and it's work perfectly...this is my code for binding to datagrid..

<mx:DataGrid includeIn="LobbyPage" x="30" y="319" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{TakeUserResult4.lastResult}">

[code]....

View 1 Replies

Data Binding - Flex Additional Label In ButtonBarButton?

Dec 5, 2011

I'm trying to extend ButtonBarButton to include an additional label that shows the number of updates for the respective box in a viewstack (which is the tabbar's dataProvider).

I can get the additional label (named indicatorLabel) to read an initial value from data, but I can't get it to update automatically like the actual "label" attribute. My understanding was that you could bind to the data object, but that doesn't appear to be the case.

[Code]...

View 1 Replies

Data Binding :: Flex AdvancedDataGrid Databind Complete Event

Jun 23, 2009

Is there some way in Flex where I can tell when all of the data has finished binding to my AdvancedDataGrid? I have a bunch of label functions that run and I need to a busy cursor while the grid gets populated. I then want to remove it when it's all done. And also fire another event.

View 1 Replies

Flex :: Passing Parameter From Main To Component With Data Binding

Aug 22, 2010

I have a main mxml file (flex4) and want to pass a parameter (user_name) to a component in a directory called components. When I run the program, the user_name is NOT being sent from the main to the component file. (Interestingly, if you make the component visible, you can see the parameter has been passed).

I have hacked much larger files down to get the following two files:
Main
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
[Code] .....

View 1 Replies

Flex :: Make Custom AS3 Classes Accessible For Data-binding?

May 28, 2011

Assume i have a custom actionscript class. [code]...

Suppose also that i have a different class, that changes a second variable, which has the metadatatag [Bindable]. What methods and events do i have to implement in either of these classes, to make myVariable change, whenever the other is changend?

View 1 Replies

Flex :: Data Binding - Update Multiple Bindable Properties In Specific Order?

Apr 20, 2011

I have a situation where I need to update a DropDownList's dataProvider and selectedItem in a specific order. See the following code ...

<s:DropDownList id="dropDownList"
dataProvider="{someDataProvider}"
selectedItem="{someSelectedItem}" />

In my case, some user interaction produces new values for the bindable variables "someDataProvider", and "someSelectedItem". However, when flex renders the DropDownList, the control's selected value is empty.

The reason for this is that the DropDownList's "selectedItem" property gets bound before the "dataProvider" property. The "dataProvider" needs to be bound first for "selectedItem" to be valid, this is because the new "selectedItem" points into the new "dataProvider".

what is the best practice for updating bindable properties in a specific order? I've come up with a few ways (e.g. using a valueCommit handler), but I wanted to see what the community had to say.

View 2 Replies

Flex :: Data Binding To A [Bindable] Property Of A Variable (unable To Detect Warning)?

Apr 1, 2012

I have the following code:

<fx:Script>
<![CDATA[
import shared.GlobalsManager;

[code].....

View 1 Replies

Flex :: Value In Datagrid Itemrenderers Set Data Method Doesn't Return The Correct Data?

Jan 10, 2012

I've got a Gridcolumn in a Datagrid (Spark). The Column's dataprovider is a Number value that gets updated via Binding.Now, without an item renderer the cell displays the correct values.If I set an item renderer, I can't access the values in this renderer.My renderer looks like this, so nothing really do here (for now) but to trace the value, but the value is always NaN.

<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" >[code].......

without the renderer, the column displays the correct values, so apparently the DefaultGridItemRenderer works fine.As requested, here is my Datagrid;

<s:DataGrid id="dataGrid" dataProvider="{_listItems}">
<s:columns>
<s:ArrayList>[code]..........

_listItems is an ArrayList with instances of a model class, which has (amongst others) a property called change of type Number.

View 1 Replies

Flex :: Data Passed From DataGridColumn.itemToLabel To DataGrid.itemRenderer.set(data)?

Dec 4, 2009

I have a DataGrid whose dataProvider is an Array of int Arrays (each with different lengths). Since each row has variable size (and I want to display all the data), I decided to extend DataGridColumn and overwrite the itemToLabel function to be able to display the data. The problem is that I also need to display the data differently depending on the int value.

I believe the only solution is to write an itemRenderer, but the only input the itemRenderer.set(data) function receives is the entire int Array. I believe I need either the exact string returned by itemToLabel or the column index of the cell the itemRenderer is for (to basically do the same parsing I implemented in itemToLabel).

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved