Alpha DevCon 2018
Results 1 to 18 of 18

Thread: {grid.Object}.refresh() w/o confirmation

  1. #1
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default {grid.Object}.refresh() w/o confirmation

    I would like to invoke the {grid.Object}.refresh() function on a grid's system events. But, if any rows are dirty, I want to simply go ahead and run the refresh without any confirmation.

    Any way to do that?
    -Steve


  2. #2
    Member
    Real Name
    Chris B
    Join Date
    May 2010
    Posts
    34

    Default Re: {grid.Object}.refresh() w/o confirmation

    Not sure if this would help, but I used the Onblur event so that when they left a field it would refresh a field I needed to refresh.

    Example from one of mine
    Code:
    {grid.Object}.refreshRow(2);
    I'm certainly no Steve Workings so is probable a jacked up way to do something your not even supposed to do.

  3. #3
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    Thanks Chris. But OnBlur isn't one of the system events I need, and you've hardcoded the rownumber which I do not want to do.
    -Steve


  4. #4
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: {grid.Object}.refresh() w/o confirmation

    If you want the dirty records to be summited use:

    {grid.Object}.submitGridPart();
    {grid.Object}.refresh();


    If you want the dirty records to be dismissed use:

    {grid.Object}._resetRow(rowNumber);
    {grid.Object}.refresh();
    Cheers
    Mauricio


  5. #5
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    Thanks Mauricio.

    The second one is what I want. But when I try that I get error:

    'rowNumber' is undefined
    -Steve


  6. #6
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: {grid.Object}.refresh() w/o confirmation

    try storing the rownumber parameter in an event that actually has that parameters (different events have different parameters)

    eg

    var Row=e.rowNumber;

    then use this in the event you want:
    {grid.Object}._resetRow(Row);
    {grid.Object}.refresh();
    Cheers
    Mauricio


  7. #7
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    Your theory is good, but I can't find a way to put it into practice.

    There's no Grid System Event that I can find that allows me to set the row numbers. This makes sense if you think about it.

    And the main events I need to use are at the grid level. So, the problem remains:

    I can't figure out how to pass rowNumbers to the various Grid System Events. Even in the grid's Javascript Row Events section, there's no OnBlur event (again, makes sense) to use to set the rowNumber.
    -Steve


  8. #8
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    What I really need here is a function that might be:

    {grid.Object}.resetGridPartWithoutConfirmation();
    -Steve


  9. #9
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    Well, after two more days at this, I'm still without a solution, to trying here one more time.

    I've moved my testing to editing a detail view. What I want is a javascript-driven approach to canceling the current record without any confirmation, then either a fetch to the last record in the grid or a detail view refresh.

    None of these do the job, but they illustrate what I've tried:

    // Works, but has a prompt:
    //{grid.Object}.resetDetailView();

    // Emits a prompt:
    //{grid.Object}.detailViewLastRecord();

    // Doesn't do the job either:
    {grid.Object}.detailViewRefresh()



    If only there was something like:

    {grid.Object}.resetDetailViewWithoutConfirmation()
    -Steve


  10. #10
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: {grid.Object}.refresh() w/o confirmation

    or

    {grid.Object}._reset();
    {grid.Object}.refresh();
    Cheers
    Mauricio


  11. #11
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    Close, but not quite. Using single-record detail-view grid form here.

    What I'm really is, using the CanUpdateRecord Event for some server-side work:

    1. Writing an Archive field value to the currently displayed record. This works.

    2. Creating a whole new record based on the currently-displayed values in the detail view. This works.

    then, using the AfterDetailViewSubmit client-side event to

    3. Move the user to the record created in #2 above. Haven't figure this out yet.
    -Steve


  12. #12
    Member Bob Moore's Avatar
    Real Name
    Robert Moore
    Join Date
    Jul 2003
    Location
    Boston, MA
    Posts
    436

    Default Re: {grid.Object}.refresh() w/o confirmation

    Steve,

    The _resetDetailViewWithoutConfirmation();
    method will reset a detail view without a confirmation message.

    Example :
    Code:
    {grid.object}._resetDetailViewWithoutConfirmation();
    There is also a _resetGridPartWithoutConfirmation() method.

    All of the grids methods (there are quite a few!) are exposed in Firebug (click on the DOM tab) and you can try them out in Firebugs' console mode so it's easy to test.

    You can also look at Alpha's A5 JavaScript for the method by clicking on the function() from the DOM tab. This can be helpful if you want a peak behind the scenes.

    Here's a video tutorial on this :

    Explore Grid Object Methods with Firebug

  13. #13
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: {grid.Object}.refresh() w/o confirmation

    Lol Its funny that that method actualy exist
    Cheers
    Mauricio


  14. #14
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,516

    Default Re: {grid.Object}.refresh() w/o confirmation

    Thanks. I'm still learning how to find some of that stuff.

    In the end, I solved my problem nicely and neatly with some good ol' Xbasic on the events.
    -Steve


  15. #15
    "Certified" Alphaholic
    Real Name
    Bill Griffin
    Join Date
    Jul 2001
    Location
    Edgewood, NY
    Posts
    1,201

    Default Re: {grid.Object}.refresh() w/o confirmation

    Steve,

    How did you refresh the grid via xbasic?

    Bill
    Bill Griffin
    Parkell, Inc

  16. #16
    Member
    Real Name
    falah failasuf
    Join Date
    Sep 2014
    Posts
    18

    Default Re: {grid.Object}.refresh() w/o confirmation

    maybe this can help

    put in client-side Event afterGridCancelEdit
    HTML Code:
    jQuery('[a5windowbuttonname="OK"]').click();

  17. #17
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,544

    Default Re: {grid.Object}.refresh() w/o confirmation

    FYI: You're responding to a post over 7 years old.

  18. #18
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,479

    Default Re: {grid.Object}.refresh() w/o confirmation

    Quote Originally Posted by Peter.Greulich View Post
    FYI: You're responding to a post over 7 years old.
    It's never too late, unless it is....
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

Similar Threads

  1. {grid.object}.methodName(); AND '{grid.object}' i
    By NicholasWieland in forum Application Server Version 10 - Web/Browser Applications
    Replies: 7
    Last Post: 02-15-2010, 03:33 PM
  2. Can not create a Grid - hc.object.Refresh method not found
    By Steve T in forum Application Server Version 10 - Web/Browser Applications
    Replies: 8
    Last Post: 01-13-2010, 09:38 AM
  3. OBJECT.REFRESH() NOT FOUND
    By scott nicholas in forum Alpha Five Version 6
    Replies: 0
    Last Post: 09-05-2005, 10:15 AM
  4. Speed up Object Refresh
    By Peter.Greulich in forum Archived Wishlist
    Replies: 6
    Last Post: 08-21-2005, 05:40 AM
  5. Tabbed object - refresh
    By fairclothjd in forum Alpha Five Version 6
    Replies: 1
    Last Post: 02-01-2005, 05:14 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
  •