Alpha Video Training
Results 1 to 6 of 6

Thread: Saving Data to the Wrong Record after {dialog.object}.refreshListData();

  1. #1
    Member
    Real Name
    Joe Lavely
    Join Date
    Jun 2013
    Posts
    463

    Default Saving Data to the Wrong Record after {dialog.object}.refreshListData();

    I have a list control in a UX.

    The list control uses a MySQL table.

    Pre-Release Build 4667-4991

    I am using {dialog.object}.refreshListData(); with the option keepFocusOnCurrentSelection = true.

    If, after refreshing the list data, a control is edited, and the action listObj.updateListFromUXControls(); is executed, the data is submitted to the first row in the list, instead of the selected row.

    Here is a video to demonstrate this https://www.screencast.com/t/ZwoM6qwUwZ

    The attached file contains the component and a dump file from the table.

    MarketIngTestList.zip

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,757

    Default Re: Saving Data to the Wrong Record after {dialog.object}.refreshListData();

    This looks like an issue. It would be my understanding that keeping focus on the current selection should make that row current... active. I've run this in 4642 with the same results. You should report it.

    In the meantime... you can do this...

    In the List Control onSelect event...

    Code:
    {dialog.Object}.__currRow = this.value;
    Then, get into your Refresh Data button action, and choose Text mode - to convert the action to Javascript. Change the code to this...

    Code:
    var options = {
    	setFocusToValue: {dialog.Object}.__currRow
    };
    {dialog.object}.refreshListData('MARKETING_LIST_TEST',options);
    So... instead of using the keepFocusOnCurrentSelection option, use the setFocusToValue option. We're saving the current key value in the List onSelect event, and using it here.

  3. #3
    Member
    Real Name
    Joe Lavely
    Join Date
    Jun 2013
    Posts
    463

    Default Re: Saving Data to the Wrong Record after {dialog.object}.refreshListData();

    I will send in a bug report.

    Your work-around, using the setFocusToValue option, is a great solution.

    Thank you!

  4. #4
    Member
    Real Name
    Joe Lavely
    Join Date
    Jun 2013
    Posts
    463

    Default Re: Saving Data to the Wrong Record after {dialog.object}.refreshListData();

    Bug report has been submitted.

    In trying to determine why this problem has occurred in some, but not all of my UXs, I discovered that it is related to the list control setting Allow Null Selection.

    If the list is set to allow null selection, this problem does not occur.

  5. #5
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,757

    Default Re: Saving Data to the Wrong Record after {dialog.object}.refreshListData();

    I looked at that as well, but, Allow NULL selection shouldn't affect the refresh option. Here is what I believe is happening...

    With Allow NULL selection turned on, the List gets refreshed, the keepFocusOnCurrentSelection fires, and then nothing else happens... all is good.
    With Allow NULL selection turned off, the List gets refreshed, the keepFocusOnCurrentSelection fires, and then the 1st row in the List is set Active, although it doesn't show as in focus. The class .listItemSelected is still attached to that previous current selection... as it should be... but the actual active row has been changed from current to 1st.

  6. #6
    Member
    Real Name
    Joe Lavely
    Join Date
    Jun 2013
    Posts
    463

    Default Re: Saving Data to the Wrong Record after {dialog.object}.refreshListData();

    This is fixed in the latest pre-release.

Similar Threads

  1. multiple users updating same record and same column.first user data is only saving
    By kalisiddhu in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 03-24-2014, 06:17 AM
  2. Dialog Component Data entered not saving on LAN
    By JetLi in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 05-04-2012, 12:09 AM
  3. Saving new data in a record list edit combo box
    By MDPriority in forum Alpha Five Version 10 - Desktop Applications
    Replies: 1
    Last Post: 11-22-2009, 02:07 AM
  4. Data going into wrong record
    By Keith Hubert in forum Alpha Five Version 9 - Desktop Applications
    Replies: 3
    Last Post: 05-18-2008, 09:03 AM
  5. Memo fields - saving to wrong record
    By Steve Wood in forum Alpha Five Version 6
    Replies: 12
    Last Post: 07-25-2005, 05:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •