Alpha Video Training
Results 1 to 6 of 6

Thread: OnExistingRowRender

  1. #1
    Member
    Real Name
    Wayne
    Join Date
    Aug 2009
    Posts
    129

    Default OnExistingRowRender

    Anyone have any idea why when I am storing a session variable on the onExistingRowRender event of a grid, the variable is only getting populated with the last row in the grid?

    e.rv.session.myvariable=e.rowData.data("myfield")

    I would use the "onclick" javascript event to solve the problem, but have yet to figure out how to pass a javascript variable into a variable in xbasic that I can use.

    Its like east and west Germany. I feel like I have to operate on either side of the wall or you get shot.

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

    Default Re: OnExistingRowRender

    Because onExistingRowRender is getting called for every existing row in your grid page. The last time this event is called is for the last row displayed. To pass a variable into a function with a callback have a look here...

    http://msgboard.alphasoftware.com/al...to-Server-Side. Remember... the wall came down a while back and the Client/Server side co-exist peacefully now... bretzen and beer for all.

  3. #3
    Member
    Real Name
    Wayne
    Join Date
    Aug 2009
    Posts
    129

    Default Re: OnExistingRowRender

    Thanks for the video link and the comment on the last row render. That makes alot of sense.

    I am using a user defined file upload, so the additional information box and debugger that Selwyn references are not available.

    I think I need to look at trying to pass args.set("cntID",e._currentRowDataNew.CNTID) into my SQL transaction within the xbasic function so I can pass the current row primary key in. I can get that reference to work in other SQL, but it isnt playing as nice on a file upload.

    Thanks for the point in a direction, that is helpful.

  4. #4
    Member
    Real Name
    Wayne
    Join Date
    Aug 2009
    Posts
    129

    Default Re: OnExistingRowRender

    Follow-up post for those who search in the future:

    I fixed my issue, but I cheated.

    In my xbasic function, I am passing through (convert_type(e.primaryKeyArray[1],"C"))
    Instead of using javascript to capture a field value on click, I am calling the E.primary key to pass my value into the xbasic and use in my SQL code.

    In this case, I am lucky that the value I want is a primary key field.

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

    Default Re: OnExistingRowRender

    Perfect... nice solution.

  6. #6
    Member
    Real Name
    Andrew Woo
    Join Date
    Jun 2012
    Posts
    19

    Default Re: OnExistingRowRender

    Wayne,

    That was a shortcut and does not work for me.

    I need to pass a Lastname from my grid, which last name is not my primary.

    Anyone can help??? Ajax callback can help on this?

Similar Threads

  1. OnExistingRowRender e.javascript - How much can I put in there.
    By Davidk in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 02-12-2011, 02: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
  •