Alpha Video Training
Results 1 to 22 of 22

Thread: {grid.Object}.refreshRow(rowNum)

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

    Default {grid.Object}.refreshRow(rowNum)

    I want to refresh whichever row the user has just updated. How do I get the rowNum?

  2. #2
    Member
    Real Name
    David Mildenhall
    Join Date
    Jul 2009
    Location
    Reading, UK
    Posts
    235

    Default Re: {grid.Object}.refreshRow(rowNum)

    Peter,

    Would placing the refresh code in the afterRowSubmit event achieve the result you are looking for? You don't then specifically need to know the rowNum.

    David.

  3. #3
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,412

    Default Re: {grid.Object}.refreshRow(rowNum)

    Saw this in another thread maybe

    e.existingRowsRendered
    Chad Brown

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by DBM View Post
    Would placing the refresh code in the afterRowSubmit event achieve the result you are looking for? You don't then specifically need to know the rowNum.
    Yes. That's the event that I am using. But I DO need the row number - I get an error message w. respect to row number not known

    Quote Originally Posted by chadbrown View Post
    e.existingRowsRendered
    Thanks for the suggestion, Chad. Tried it - no dice.

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    try
    {grid.Object}.refreshRow({Grid.RowNumber})
    Cheers
    Mauricio


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

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by mmaisterrena View Post
    {grid.Object}.refreshRow({Grid.RowNumber})
    Nope. Error message says "Expected ":"

    But thanks.

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    where are you placing the code?
    Cheers
    Mauricio


  8. #8
    Member
    Real Name
    Wolfgang Marcus Zwing
    Join Date
    Jul 2009
    Posts
    111

    Default Re: {grid.Object}.refreshRow(rowNum)

    Peter

    The rowNumber parameter is not available for this event, but you can get it easily:

    In the Javascript function declaration section, define a new variable such as
    Code:
    var rn=0;
    In the canRowSubmit, which does make the rowNumber parameter available, write
    Code:
    rn=e.rowNumber;
    And finally, in the event you are using , i.e.
    afterRowSubmit, use the variable. i.e.
    Code:
    alert(rn);
    Note that afterRowSubmit only fires after the user has clicked the submit row button in a Grid row and not the submit button for the whole grid.

    Hope this helps

    Regards

  9. #9
    "Certified" Alphaholic
    Real Name
    Frank Bicknell
    Join Date
    Feb 2010
    Location
    39.1915° N, 84.4348° W
    Posts
    2,467

    Default Re: {grid.Object}.refreshRow(rowNum)

    Peter I have used that in the AfterGridSubmit event under Javascript - System Events and it does seem to just refresh the row whith the dirty records. It works when you have just one submit button since I am not using individual row submits I don't know if it would work in that case.

  10. #10
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,070

    Default Re: {grid.Object}.refreshRow(rowNum)

    Isn't there already an option under update options to do that automatically?

  11. #11
    Member parri2bd's Avatar
    Real Name
    Benjamin Parrish
    Join Date
    Oct 2007
    Posts
    102

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by NoeticCC View Post
    Isn't there already an option under update options to do that automatically?
    Yes. See the thumbnail provided.

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    Wolfgang - still won't work. None of the other methods work, except pressing F5 or going to another page in the grid and coming back again. BTW: all I am trying to do is change the conditional style of a field based upon another field's value. Conditional style level is set to "both".

  13. #13
    Member
    Real Name
    Wolfgang Marcus Zwing
    Join Date
    Jul 2009
    Posts
    111

    Default Re: {grid.Object}.refreshRow(rowNum)

    Peter

    I see what you mean. Don't know if this is an option, but if you follow the advice from NoeticCC & parri2bd and set the Row refresh method after edits to FullPage, it should work. At least it worked for a simple example I did setting the background color of a field depending on the value of another field.
    Using any other setting for this property does not work.

    Regards

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by wmz View Post
    I see what you mean. Don't know if this is an option, but if you follow the advice from NoeticCC & parri2bd and set the Row refresh method after edits to FullPage, it should work.
    OK. Thanks Wolfgang and everyone else. Full Page works. I was trying to avoid a re-fetch of the entire page, but I guess I have no choice. Wonder if this qualifies as a bug?

  15. #15
    Member
    Real Name
    Wolfgang Marcus Zwing
    Join Date
    Jul 2009
    Posts
    111

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by Peter.Greulich View Post
    OK. Thanks Wolfgang and everyone else. Full Page works. I was trying to avoid a re-fetch of the entire page, but I guess I have no choice. Wonder if this qualifies as a bug?
    Peter

    with Alpha you always seem to have a choice. You can avoid a re-fetch of the page. Just use a watch event for the field whos value you want to survey, then use javascript and the appropriate helper function to set the other field's style. For example, I have the following code in the watch event:
    Code:
    if (*gv('LNAME')=='Bond'){
    *ss('FNAME','color:red;')
    }
    else{
    *ss('FNAME','color:black;')
    };
    It simply checks if the last name is "Bond" and sets the style of the first name field to red color, else to black color. You can set any CSS you want. It is important to define both styles, i.e. use an if then else to include both possibilities. This does not refresh the whole page. The helper functions *ss() and *gv() etc. are all explained in the property window.

    regards
    Last edited by wmz; 03-15-2010 at 02:00 PM. Reason: mistake

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    Thanks Wolfgang. I'll check this out. I have used the watch event in a different context. Didn't even occur to me here.

  17. #17
    Member StephenP's Avatar
    Real Name
    Stephen Pilon
    Join Date
    Apr 2000
    Location
    Front Royal, Virginia
    Posts
    491

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by Peter.Greulich View Post
    Nope. Error message says "Expected ":"
    I had this error for different things, and was going to report it as a bug...but I haven't had it again since then. I've seen others mention the same thing: Expected '":"

    Perhaps people should start reporting this as a bug. It seems to be popping up a lot in the use of Inline-Javascript.
    Stephen Pilon
    Associate Librarian
    Christendom College

  18. #18
    "Certified" Alphaholic
    Real Name
    Frank Bicknell
    Join Date
    Feb 2010
    Location
    39.1915° N, 84.4348° W
    Posts
    2,467

    Default Re: {grid.Object}.refreshRow(rowNum)

    I get that error on occasion too. Usually, at least in in my case, it is because I have an error somewhere in the javascript that has nothing to do with a ':' character. There must be a better way to debug javascript.

  19. #19
    Member parri2bd's Avatar
    Real Name
    Benjamin Parrish
    Join Date
    Oct 2007
    Posts
    102

    Default Re: {grid.Object}.refreshRow(rowNum)

    set the Row refresh method after edits to FullPage, it should work.
    You don't have to fetch the full page there are other options, one is 'RowOnly', which should be all you need. It automatically selects the best method for you by doing AutoSelect for what you need, which might be doing the 'Minimal' option.

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

    Default Re: {grid.Object}.refreshRow(rowNum)

    Quote Originally Posted by parri2bd View Post
    You don't have to fetch the full page there are other options, one is 'RowOnly', which should be all you need. It automatically selects the best method for you by doing AutoSelect for what you need, which might be doing the 'Minimal' option.
    Sorry, been there, done that.
    RowOnly doesn't work.
    AutoSelect doesn't work.

  21. #21
    Member
    Real Name
    Bill
    Join Date
    Jan 2009
    Posts
    182

    Default Re: {grid.Object}.refreshRow(rowNum)

    Has anyone figured this one out yet?

    I'm in a similar position where I have checkboxes in the row. Some conditional styling then sets the colours of certain objects in the row, but only after a full page refresh.

    It would be REAL NICE if after submitting the row, the row only was refreshed, so the colours reflected the values.

    Thanks,
    Bill

  22. #22
    Member
    Real Name
    Leendert Moerkerken
    Join Date
    Mar 2011
    Location
    Parramatta Australia
    Posts
    3

    Default Re: {grid.Object}.refreshRow(rowNum)

    I found that setting a second condition 1=1 forcing the row to return to the correct colour was necessary, this only worked for conditional formating on the client side.

    Thanks,

    Leendert

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, 04: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, 10:38 AM
  3. {grid.Object}._setValue not working?
    By GarthMc in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 01-12-2010, 05:56 PM
  4. "Object Required" Error in Grid Detail - troubleshooting
    By fsi in forum Application Server Version 9 - Web/Browser Applications
    Replies: 6
    Last Post: 08-26-2009, 04:50 PM
  5. Updating the main grid with info from the child grid in a tabed grid linker
    By Mwhite in forum Application Server Version 9 - Web/Browser Applications
    Replies: 5
    Last Post: 06-30-2009, 06:40 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
  •