Editable DataGrid and setInterval()

I have a page with an editable datagrid on it. I am not using
any item renderers or anything. Also I am refreshing this page
every five seconds by doing a setInterval() on it. Here's the
scenario which is causing the problem.
I select a cell to edit. The cell's look changes from regular
text to the look of an editable field. However if the refresh
happens before I make my changes, the cell gets converted back to
regular text. Is there a way for me to maintain the editability of
the cell through the refresh or should I use some other method of
refreshing the data?

It seems to me that if the user has started entering data,
that you should suspend the refresh activity entirely, until the
current data is saved. Otherwise, it wll be nearly impossible to
update the data, since few people will be able to type and samve
sopmething in less than 5 seconds.
Tracy

Similar Messages

  • Editable Datagrid: focus shifts to next row on click : Urgent

    I have an editable datagrid and when I change the value of a cell and then instead of tab I click on the cell adjacent to it, the focus automatic shifts to the next row. I have no freaking idea why?
    Any help is appreciated. Thanks a ton in advance.

    Issue Resolved 
    Need to set lead selection to next element in the node using MOVE_NEXT method of IF_WD_CONTEXT_NODE interface.
    rest of the code remains same.

  • Editable DataGrid won't sort correctly

    This is the weirdest behavior I've ever seen...
    I am working on a datagrid (editable="true"), and for some reason the thing does not want to sort correctly. It is a basic datagrid with itemrenderers for each column so that we can edit in the grid. Sorting should happen on a header-click, but if you click the header, it seems to simply select the first row, or another random row, and doesn't sort. It does fire the "itemEditEnd" event. However, if you click anywhere but the header, drag the mouse to header and then let go,  (mouseUp on the header), then it sorts perfectly fine (and doesn't fire that event). If I take the "editable=true" off the datagrid, it sorts fine on header-clicks, but then the datagrid won't save.
    Does anyone have any ideas? There isn't any custom behavior on the header, though I could add some if it would help. I've tried everything I can think of, but nothing seems to help.
    This seems to be somewhat related to this (unsolved) issue.
    http://bugs.adobe.com/jira/browse/SDK-18302
    Thanks,

    I have noticed in the livedocs under, "Working with item renderers" (currently as I type this post the livedocs is unavailable, so I am able to give you a URL) there is a Datagrid that functions incorrectly when the user clicks on header columns.  I am not sure why they haven't fixed this yet, but is this similar to what you are experiencing?  I believe on the same page, they mention about the differences with creationComplete and dataChange.  Are you listening to any of those events?  creationComplete is rarely used in an itemrenderer.   dataChange is used more often which I have noticed that a conditional statement is needed to prevent strange behavior (perhaps the same as you mentioned).

  • Editable DataGrid With DateField

    I'm new to flex and struggling with the editable DataGrid. I
    have a DataGrid with an ItemRenderer that outputs a DateField. I
    can't figure out how to get the new value of the DateField after
    the edit.
    Here is my DataGrid (the endDate column):
    <mx:DataGrid id="allHistoryGrid"
    dataProvider="{allEntries}" height="313" width="782" y="-4"
    itemEditEnd="saveGridChange(event)" editable="true">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn dataField="dietDescription"
    headerText="Diet"/>
    <mx:DataGridColumn dataField="allergyDescription"
    headerText="Allergy"/>
    <mx:DataGridColumn dataField="labDescription"
    headerText="Lab"/>
    <mx:DataGridColumn dataField="labResult" width="50"
    headerText="Result" itemRenderer="LabResultItemRenderer"/>
    <mx:DataGridColumn dataField="medicationDescription"
    headerText="Medication"/>
    <mx:DataGridColumn dataField="height" width="65"
    headerText="Height" itemRenderer="HeightItemRenderer"/>
    <mx:DataGridColumn dataField="weight" headerText="Weight"
    itemRenderer="WeightItemRenderer"/>
    <mx:DataGridColumn dataField="bmi" width="35"
    headerText="BMI" itemRenderer="BmiItemRenderer"/>
    <mx:DataGridColumn dataField="circumference" width="45"
    headerText="Circ." itemRenderer="CircumferenceItemRenderer"/>
    <mx:DataGridColumn headerText="Start Date" width="75"
    sortCompareFunction="startDateSortCompare">
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox clipContent="false">
    <mx:DateFormatter id="dateFormatter"
    formatString="MM/DD/YYYY"/>
    <mx:Text width="100"
    text="{dateFormatter.format(data.startDate)}"/>
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    <mx:DataGridColumn dataField="endDate" width="45"
    headerText="End Date" itemRenderer="EndDateItemRenderer"
    rendererIsEditor="true"/>
    <mx:DataGridColumn id="deleteEntry" width="50"
    textAlign="center"
    headerText="Delete" sortable="false"
    itemRenderer="DeleteItemRenderer"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    Here is my itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    paddingLeft="16" horizontalAlign="center">
    <mx:DateFormatter id="dateFormatter"
    formatString="MM/DD/YYYY"/>
    <mx:DateField x="16" y="67" id="AllHistoryEndDate"
    text="{dateFormatter.format(data.endDate)}"/>
    </mx:VBox>
    How do I get the new value in the saveGridChange function?
    private function saveGridChange(event:DataGridEvent):void {

    That gives me this error:
    TypeError: Error #1034: Type Coercion failed: cannot convert
    EndDateItemRenderer@51a70a1 to mx.controls.TextInput.

  • Formatting a field before committing from editable datagrid

    Hi,
    I have an editable DataGrid which displays two columns, date
    and value. Now, the date in the dataProvider is actually stored as
    an integer (yyyymmdd) so I format it using a labelFunction to
    display. I then have a custom itemEditor to set it to a date for
    calling into the DateField.
    The next step, and where I'm struggling, is to update the
    dataProvider with an integer (yyyymmdd) calculated from the
    selectedDate. Can someone please help me with how to do this?
    Thanks!

    See the docs for data grid editing events, such as, I think,
    itemEndEdit.

  • GridView vs DataGrid and gateway

    Used to use DataGrids and in a template field Hyperlink, the portal converts the link to a fully gatewayed link... GridView Hyperlinkfield does not get "gateway converted"? Thoughts? Guess I could use a TemplateField, but was hoping to use a more default solution.
    EDIT: it appears that a template column with a hyperlink in a GridView does not get "gateway converted" either, hmmmm. Back to tesing and tinkering
    EDIT: I am a moron....have to set the gateway prefix in teh Web Service.....jsut shoot me now! TGIF!
    Edited by: mbowles on Nov 7, 2008 7:56 AM
    Edited by: mbowles on Nov 7, 2008 8:00 AM

    Doh..built my web app in VS2008 w/o using the app accel / AquaLogicWCLoader. It started out as a LINQ o/r mapping experiment - but am trying to take a step further and get into the portal. I'll tweak the web app (referenes to idk and wcloader, web forms into partial classes inheriting from BEA.ALI.Web.UI.ALIPortletPage) and see if that fixes. I'll keep the group posted.
    Bah-zing! It worked. As usual, thanks again, Joel!
    Edited by: tjannotta on Feb 17, 2009 9:37 AM

  • Editable datagrid firefox problem

    I have created an application that contains an editable
    datagrid but experiences problems when using the firefox browser.
    If there are multiple tabs of firefox open and an item is selected
    in the grid, when switching between the firefox tabs, the datafield
    in the grid becomes selected for edit without clicking on it. It
    appears that some kind of event is being called to change an entry
    in the grid. Similar results occur when changing between different
    windows i.e. firefox and flex builder.
    However, I don't have this problem when using internet
    explorer.

    That should be true for any Flex component.  Focus is always on something, you have to move it to a new place otherwise it gets restored back to what last had foucs.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Editable Datagrid from programmaticaly built XmlListCollection help needed

    Hi, I am trying to build an editable datagrid with 20 empty
    rows in it. Users will fill out the cells, this then gets persisted
    to a DB, then later by making selections in a combobox, they can
    bring this data back for viewing and/or modification. I have been
    trying to create the XML dynamically and then addItem on the
    XmlListCollection to no avail. Can someone please point out where I
    am going wrong? Thanks!
    [Bindable] private var teamGridDataAsXml:XML;
    [Bindable] private var teamGridData:XMLListCollection;
    private function initEmptyTeamGrid():void {
    teamGridData = new XMLListCollection();
    var s:String = "<rows>";
    for(var i:int = 0; i < 20; i++) {
    s += "<row rowIndex=\'" + i + "\' agentId='' firstName=''
    lastName='' country='' />";
    s += "</rows>";
    teamGridDataAsXml = new XML(s);
    teamGridData.addItem(teamGridDataAsXml);
    <mx:DataGrid id="agentInfo" editable="true"
    dataProvider="{teamGridData}" width="100%" height="100%"
    rowCount="20">
    <mx:columns>
    <mx:DataGridColumn headerText="#" dataField="@rowIndex"
    editable="false"/>
    <mx:DataGridColumn headerText="Agent ID"
    dataField="@agentId" editable="true"/>
    <mx:DataGridColumn headerText="First Name"
    dataField="@firstName" editable="true"/>
    <mx:DataGridColumn headerText="Last Name"
    dataField="@lastName" editable="true"/>
    <mx:DataGridColumn headerText="Country"
    dataField="@country" editable="true"/>
    </mx:columns>
    </mx:DataGrid>

    teamGridDataAsXml = new XML(s);
    trace(teamGridDataAsXml.toXMLString() ); to be sure you have
    good xml
    var xlRows:XMLList = teamGridDataAsXml.row;
    trace(xlRows.length()); //what you expect?
    teamGridData =new XMLListCOllection(xlRows);
    You could skip the xml variable and go straignt into the
    XMLListCollection also. In the loop, build the XML node, using XML
    literal syntax, and then call addItem *inside the loop*.
    Tracy

  • Editable Datagrid

    Hi All,
    I have a editable datagrid using vertical scroll, every time i finish editing a top row the cursor jumps down and the scroll bar moves down also.
    This only happens when i use itemEditEnd event.
    Any ideas?
    Thanks
    (Using SDK 4.5.1)

    I see this behavior using itemEditEnd but only when I do refresh the arraycollection data of the grid. I am using:
    protected function laborRates_itemEditEndHandler(event:DataGridEvent):void
                 if (event.reason == DataGridEventReason.CANCELLED)
                        // Do not update cell.
                        return;
                    if (isNaN(event.currentTarget.itemEditorInstance.text) || event.currentTarget.itemEditorInstance.text == "" || Number(event.currentTarget.itemEditorInstance.text) < 0 ){
                        event.currentTarget.itemEditorInstance.text = 0;
                    event.currentTarget.dataProvider.refresh();  //Here is the issue
    Any ideas how can I control this scroll?
    Thanks

  • Editable Datagrid with LabelFunction Problems

    Hi,
    I'm having problems with a datagrid with editable columns and labelFunctions.
    The problem is that when i leave the editable field by a way that wasnt with Escape Key, the datagrid apply again the labelFunction and destroy the number formattion adding a lot of numbers.
    When the field is filled with 0000,00 he just adds more zeros, like 0.000.000,0000 and keep going after do the same process.
    And when the field has a number different of zero, he apply the labelFunction then after he remove the labelFunction. After few times it just make the number vanish and the cell goes empty.
    I read the documentation about editing cell and tryed to implement a solution to prevent the cell be edited, without sucess.
    The source code goes attached for some advice on my problem.
    Thanks, Fredy.

    Hi,
    I solved a part of problem with some changes that i've made.
    Now there is no problem with values different of zero, when i got just number, its fine, but still have problems with zero values.
    The snippet code goes next, the bold part that was modified from the last sample.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="vertical"
         backgroundColor="white">
         <mx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.DataGridEventReason;
                   import mx.controls.TextInput;
                   import mx.controls.dataGridClasses.DataGridColumn;
                   import mx.formatters.NumberFormatter;
                   import mx.events.DataGridEvent;
                   import mx.collections.ArrayCollection;
                   [Bindable] private var collection:ArrayCollection = new ArrayCollection([
                        {code:1, description:"Item 1", value:4564654},
                        {code:2, description:"Item 2", value:00000000},
                        {code:3, description:"Item 3", value:00000000},
                        {code:4, description:"Item 4", value:00000000},
                        {code:5, description:"Item 5", value:00000000},
                        {code:6, description:"Item 6", value:00000000},
                        {code:7, description:"Item 7", value:00000000}
                   private var formatter:NumberFormatter;
                   private function formatterFunction(item:Object, column:DataGridColumn):String {
                      if (formatter == null){
                           formatter = new NumberFormatter();
                           formatter.decimalSeparatorTo = ",";
                           formatter.thousandsSeparatorTo = ".";
                           formatter.decimalSeparatorFrom  = ",";
                           formatter.thousandsSeparatorFrom = ".";
                           formatter.useThousandsSeparator = true;
                           formatter.precision = 4;
                      return formatter.format(item[column.dataField]);
                 private function editEndHandler(event:DataGridEvent):void {
                    var myEditor:TextInput = TextInput(event.currentTarget.itemEditorInstance);
                    var newVal:Number = isNaN(Number(myEditor.text)) ? myEditor.text as Number : 0.0000;
                    var oldVal:Number = Number(event.currentTarget.editedItemRenderer.data[event.dataField]);
                     // it solves the partial part of the problem, but still have some errors
                     if (event.reason == DataGridEventReason.CANCELLED || event.reason == DataGridEventReason.OTHER) {
                        return;
                    if (oldVal == newVal ) {
                             // i've tryed this, but the itemEditor still open
                             event.preventDefault();
                             // if I just put 'return', still have the same problem
                             // return;
              ]]>
         </mx:Script>
         <mx:Label text="Bug datagrid editavel com labelFunction"
              fontSize="16"
              fontWeight="bold" />
         <mx:DataGrid dataProvider="{collection}"
              editable="true"
              itemEditEnd="editEndHandler(event)">
              <mx:columns>
                   <mx:DataGridColumn headerText="Código"
                        dataField="code"
                        editable="false"/>
                   <mx:DataGridColumn headerText="Descrição"
                        dataField="description"
                        editable="false"/>
                   <mx:DataGridColumn headerText="Valor"
                        width="300"
                        dataField="value"
                        labelFunction="formatterFunction"
                        editable="true"/>
              </mx:columns>
         </mx:DataGrid>
    </mx:Application>
    @Alex
    Thanks for the answer.
    I want to edit this column, but if there is no 'change' i dont want to apply again the label function and close the itemEditor.
    I've tryed to call event.preventDefault() but i dont know what to do next.
    Do you have some advice how to solve my problem?
    This is just happening when i got zero values on my datagrid =/
    Thanks all for the answers.

  • ErrorTemplate on editing datagrid

    Hello,
    I'm trying to create a MVVM application to register purchases.
    I have ViewModel composed by :
    Purchase
    Products (return collection of products of the Purchase(Purchase.products)
    ProductToAdd (this is a product to add to the Purchase via button)
    Implement IDataErrorInfo to validate the order and the products collection
    I created a collection of error to validate the ProductToAdd on button click.
    So if there is an error on ProductToAdd the product is not add to the collection and the textbox with error become Red.
    The value of each product of the purchase can be updated in the datagrid.
    My problem is : When i update value in DataGrid the cell updated didn't get errorTemplate when is there an error.
    My sample is the following : http://www.filedropper.com/validationexample_3
    I didn't know how can i do 2 type of validation.
    thanks

    The Product class could implement the IEditableObject interface to keep track of whether it is currently in edit mode and then do the validation also in the setter if it is:
    public class Product : IDataErrorInfo, INotifyPropertyChanged, IEditableObject
    private string _Name = null;
    [Required(ErrorMessage = "Nom is required")]
    public string Name
    get
    return _Name;
    set
    _Name = value;
    if (_isInEditMode) {
    Validate();
    RaisePropertyChanged("Name");
    private int? _Quantity = null;
    [Required(ErrorMessage = "Quantity is required")]
    [Range(1, 9, ErrorMessage = "Quantity must be superior to 0 and inferior to 10")]
    public int? Quantity
    get
    return _Quantity;
    set
    _Quantity = value;
    if (_isInEditMode) {
    Validate();
    RaisePropertyChanged("Quantity");
    public Dictionary<string, string> _errors = new Dictionary<string, string>();
    public bool Validate()
    _errors["Name"] = Validateurs.Courant.GetErreur(this, "Name");
    _errors["Quantity"] = Validateurs.Courant.GetErreur(this, "Quantity");
    RaisePropertyChanged("Name");
    RaisePropertyChanged("Quantity");
    if (_errors["Name"] != "" || _errors["Quantity"] != "")
    return true;
    return false;
    #region INotifyPropertyChanged
    public void RaisePropertyChanged(string propertyName)
    if (this.PropertyChanged != null)
    this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    public event PropertyChangedEventHandler PropertyChanged;
    #endregion
    #region IDataErrorInfo
    public string Error
    get
    throw new NotImplementedException();
    public string this[string columnName]
    get
    if (_errors.ContainsKey(columnName))
    return _errors[columnName];
    return null;
    #endregion
    #region IEditableObject Members
    private bool _isInEditMode;
    public void BeginEdit() {
    _isInEditMode = true;
    public void CancelEdit() {
    _isInEditMode = false;
    public void EndEdit() {
    _isInEditMode = false;
    #endregion
    To remove the red exclamation mark that may get stuck in the row header even if you type in a valid value in the cell, you could use the following RowStyle:
    <DataGrid Width="477" Height="200" Canvas.Left="10" Canvas.Top="157"
    ItemsSource="{Binding products}" AutoGenerateColumns="False">
    <DataGrid.RowStyle>
    <Style TargetType="DataGridRow">
    <Setter Property="ValidationErrorTemplate" Value="{x:Null}"/>
    </Style>
    </DataGrid.RowStyle>
    <DataGrid.Columns>
    Please refer to the following thread for more information about this:
    http://stackoverflow.com/questions/5099039/wpf-datagrid-validation-errors-not-clearing
    And remember to mark helpful posts as answer and to start a new thread if you have a new question.

  • I was editing photos and it was getting stuck or frozen and working really slow, so I attempting to close aperture and reopen it but it won't quit aperture and now it won't open up to my photos either.  Any ideas?

    I was editing photos and it was getting stuck or frozen and working very slowly.  I attempted to restart the computer but it would not allow me to quit aperture.  Now aperture appears in my toolbar but will not open up so I can work on any photos.  Any ideas?

    Did you try opening from the Applications folder?
    Depending on how far that gets you, I would also take a look at the Troubleshooting Basics.

  • I get this error when I go to imovie, I have instalerat on via appstore, but it does not work. The QuickTime components necessary to view, edit, import and export various types of films are not installed. The components included in the iMovie installer. R

    I get this error when I go to imovie, I have instalerat on via appstore, but it does not work.
    The QuickTime components necessary to view, edit, import and export varioustypes of films are not installed. The components included in the iMovie installer.Reinstalling iMovie.

    I get this error when I go to imovie, I have instalerat on via appstore, but it does not work.
    The QuickTime components necessary to view, edit, import and export varioustypes of films are not installed. The components included in the iMovie installer.Reinstalling iMovie.

  • Both my iPad and iPhone have ios8 On either device in Calendars edit shared with add person when I enter an email address and press add nothing happens - just goes back to edit screen and what I have entered has gone. No error message or any clue

    Both my iPad and iPhone have ios8
    On either device in Calendars> edit >shared with> add person when I enter an email address and press add nothing happens - just goes back to edit screen and what I have entered has gone. No error message or any clue about why I cant share my calendar. Please help.

    UDPATE:
    Spoke with Express lane, and issue was escalated.  Kudos to the support guys that handled this one (Brian and Yi).  Went through everything in detail and took all the crash dumps off the iphones and ipads to send to engineering.
    After backing up the contacts, the recommendation was to delete all contacts in  iCloud.  Doing that caused my iCloud to crash (in the browser), so more crash dumps were sent to apple.
    Eventually got all contacts deleted, then did a resync.  Looks like IOS devices are coming back to life and syncing again.
    Also, Outlook iCloud connector has just been updated to ver 1.0.1 so i installed that on their recommendation.
    BOTTOM LINE workaround:
    1. Backup contacts
    2. Delete contacts in iCloud
    3. Delete accounts on IOS devices
    4. Recreate accounts on IOS devices.
    Hoping a real root cause can be found and real fix implemented.  This has caused me to doubt the stability of iCloud, so i will procees with caution.

  • I have created a form in InDesign, exported to a pdf, created an editable form and saved.  When I open the form and make changes and save, the reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is alway

    I have created a form in InDesign, exported to a pdf, then created an editable form and saved.  When I open the form and make changes and save, then reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is always minus the edits.   ????

    Hi chuck,
    If you ave created the form and then filling it yourself and saving the form, the filled data should be there when you reopen the same form.
    Can you please send the form to me at [email protected]  so that I can have a look.
    Regards,
    Rave

Maybe you are looking for

  • Old pictures can not display after Itunes upgrade

    Earlier today I updated to the newest version of Itunes. I also added some new pictures to my synched directory for pictures (this directory has approx 725 pics that were all on my phone prior to this update of Itunes). When I synched to add the new

  • FAGLB03 Balances not matching

    Hi Experts,   For a particular GL range I am executing the balances in T.Code - FAGLB03. Once execution its showing opening balance(Cumulative Balance) Rs. 5,00,000. When I double click on this balance its showing only Rs. 4,50,000.  I have checked t

  • Possible to get 'Automatic' device register without NSP ?

    Hi  Anybody pleade hint me config ISE1.2 I need to do separated ssid called on-board. Once non registed device comes in, ISE get sredirect to registering portal.  I can finish self fill in device register which user need to fill in his MAC manually.

  • Variable, Multi-plot XY Graph?

    Hey all, first text to the forums so here goes: The issue I have deals with processing data from a number of strain gages.  My goal is to do the following:    -  At the press of a button ("Push to Snapshot XY Points"), I need to collect a "snapshot"

  • How to check memory usage of a debug

    I am very new, sorry for any newbishness on my part. Is there a way to track how much memory your debug is using?  I am trying to make a game, and I have 2 ways of doing something. One with an array of square objects doing hitTest, and one only 1 obj