Alpha Video Training
Results 1 to 3 of 3

Thread: Can I get at the buttonID that called an Ajax Callback within an Xbasic Function?

  1. #1
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Can I get at the buttonID that called an Ajax Callback within an Xbasic Function?

    I'm sifting through the e. object and looking for it right now but I can't seem to find it, if it exists.

    I'd like to know the button ID (within my xbasic function) of the button that called my file download ajax callback.

    My button is located in a grid row.

    I want to conditionally branch my function based on the button ID so I don't have to clutter up my functions area with multiple ones for 4 buttons that do the same thing but in different ways.

    Thanks!

  2. #2
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,615

    Default Re: Can I get at the buttonID that called an Ajax Callback within an Xbasic Function?

    How about using the additionalData parameter of your callback? I don't know my javascript well enough, but you should be able to return the ID or name of "this"
    -Steve


  3. #3
    Member -Jinx-'s Avatar
    Real Name
    Jinx
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    963

    Default Re: Can I get at the buttonID that called an Ajax Callback within an Xbasic Function?

    Quote Originally Posted by Steve Workings View Post
    How about using the additionalData parameter of your callback? I don't know my javascript well enough, but you should be able to return the ID or name of "this"
    Hi Steve,
    That is indeed what I ended up doing. Well, mostly. I hard coded for each button. I converted my file download action to text mode and added ?btype=thethingimchecking and then grabbed it in the e.dtype in my xbasic function. I then used it to branch conditionally.

    It would still be nice to know if a guy could get that button id though. It could come in useful for a number of things. I never thought of getting it with the javascript like you suggest and then setting that into the callback variable. That would be a good inbetween route.

    On the ajax callback note..... Do you have problems if you try to put the additional data to submit in an ajax callback when doing it from the helper function in a button? That variable will never transfer for me unless I convert the callback to text mode and enter it in there. Just wondering if other users were finding the same.

Similar Threads

  1. Reference javascript function in Ajax Callback
    By jrturner0112 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 11-01-2013, 08:03 AM
  2. How to manually perform an Ajax callback to a xBasic function
    By WindForce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 12
    Last Post: 04-13-2013, 11:43 AM
  3. Duration of an xBasic function called by an Ajax Callback
    By WindForce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 03-20-2012, 03:20 PM
  4. How to Create an xBasic Function to Use an Ajax Callback to Place a Marker On a Map
    By forskare in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 03-14-2012, 11:36 PM
  5. V10 Ajax Callback to XBasic Function
    By ismac in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 07-29-2009, 06:52 AM

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
  •