Alpha Video Training
Results 1 to 5 of 5

Thread: > On Click vs Right Click - Getting Value Doesn't Work The Same For Me

  1. #1
    Member
    Real Name
    Lily Von Ohlen
    Join Date
    Aug 2012
    Posts
    211

    Post > On Click vs Right Click - Getting Value Doesn't Work The Same For Me

    I have successfully used the following code on a click event on my list

    Code:
    var lObj = {dialog.object}.getControl('Prospects');
    var listPK = lObj.selectionData[0].client_list_id;	
    alert(listPK);
    On the same list I have duplicated the code for Right click as I need the primary key for that action as well but I can't get it to work, and any other way I've tried hasn't worked

    The amount of things I've tried aren't even worth typing in here, I hope it's an easy fix that I'm just doing wrong. I've set the return value to Primary Key I've also tried it as a field but haven't and set that to my client_list_id (which is my primary key) and neither have made a difference.

    I would really appreciate any insight, I feel like I'm losing my mind!

    Thanks!

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

    Default Re: > On Click vs Right Click - Getting Value Doesn't Work The Same For Me

    Is the list you're clicking on the same list as Prospects? Or is Prospects a different list.

    I didn't even know there was a right-click... cool.

    I've got this code in the right-click event of a list... and it's working.

    Code:
    var empFN = this.selectionData[0].FirstName;
    alert(empFN);

  3. #3
    Member
    Real Name
    Lily Von Ohlen
    Join Date
    Aug 2012
    Posts
    211

    Default Re: > On Click vs Right Click - Getting Value Doesn't Work The Same For Me

    :-) That right click is nice, but probably only for desktop, so I'm trying to use it for a menu that wouldn't be used on a regular basis but would be nice if easily accessible when needed.


    Both events (click and right click) are for the same list, Prospects.

    I tried your code, it didn't work for me. Do I have to setup "this" in someway, it never works for me. I get the error message...

    Code:
    TypeError: this.selectionData[0] is undefined
    I also tried your same code with defining the list object and this didn't work either, :-(

    Code:
    //var listPK = lObj.selectionData[0].client_list_id;	
    //var listPK = {dialog.object}.getValue('list::Prospects::client_list_id');
    //var listPK = this.selectionData[0].client_list_id;
    var lObj = {dialog.object}.getControl('Prospects');
    var listPK = lObj.selectionData[0].client_list_id;
    
    ERROR MESSAGE:
    TypeError: lObj.selectionData[0] is undefined
    

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

    Default Re: > On Click vs Right Click - Getting Value Doesn't Work The Same For Me

    Sorry Lily... I think I had an onClick defined as well... which made it look like the right-click event was good.

    What's happening is that the onClick event is setting focus to the row you're clicking on. Right-click does not do this.

    So... you need to set focus first... then all is good.

    Code:
    this.setValue(arguments[0]);
    var empFN = this.selectionData[0].Firstname;
    alert(empFN);
    Attached is a sample UX as well.
    Attached Files Attached Files

  5. #5
    Member
    Real Name
    Lily Von Ohlen
    Join Date
    Aug 2012
    Posts
    211

    Default Re: > On Click vs Right Click - Getting Value Doesn't Work The Same For Me

    Oh my goodness, I can't believe it works, I've been losing my mind over this! Thank you so much David!!!! I appreciate it :-)

Similar Threads

  1. Right Click Browser Menu Pops Up Along with My Right Click Action
    By RankFirstPro in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 09-17-2014, 05:42 PM
  2. Replies: 2
    Last Post: 01-17-2014, 11:46 PM
  3. Button to open grid doesn't work if user doesn't have update security rights
    By iviowa in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 07-01-2010, 10:54 AM
  4. XBASIC - Right Click Doesn't Work
    By rtbtat in forum Alpha Five Version 5
    Replies: 7
    Last Post: 06-22-2004, 01:40 PM
  5. On-Click help needed
    By Tom Patten in forum Alpha Five Version 4
    Replies: 5
    Last Post: 01-25-2001, 03:35 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
  •