PxPlus User Forum

Twitter Twitter Twitter

Author Topic: 2nd list box not responding to single click  (Read 1083 times)

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
2nd list box not responding to single click
« on: April 06, 2020, 09:45:49 PM »
Help with a list box.

Got a panel with two 2 list boxes set the same way as: report view and automatic signal all changes, and full line highlight on.  Listbox1 is detail lines.  Listbox2 is completed contract#'s.   Multi-line1 is contract#.  When entering qty, price, etc they click ADD and I load listbox1.  The focus goes back to QTY multi-lines so they can enter details for a new row.  Even with focus (blinking cursor) on QTY, they can click on any row in listbox1 and Listbox1 performs the logic setup under When Entry is Selected from List Box first time, and each time.

However listbox2, a list of completed contract#s requires a double click first, and then afterwards a single click works as long as it has focus.  How can I fix this so listbox2 responds on a single click the first time like listbox1?  I want this to happen when focus is on contract# multi-line. 

I found that after the invoice is done instead of putting focus on the contract#, if I put focus on the listbox2, THEN it works with single click. I did this with NEXT_ID=LISTBOX2.CTL   But I want focus on contract#, not listbox2.  Possible?

I've tried all kinds of this/that.  Perplexed.

PxPlus Version 14.10.0000

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: 2nd list box not responding to single click
« Reply #1 on: April 07, 2020, 10:28:34 AM »
I would double check the automatic setting on the second list but also see if it has on focus logic that could be impacting the events.  For example if the second list box has an on focus event that itself changes focus or perhaps reloads the list. 

Reloading the second list on focus would cause the system not to send single click since it cannot determine if the reloaded list box contents matches the contents that the user actually clicked on.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: 2nd list box not responding to single click
« Reply #2 on: April 07, 2020, 11:05:13 AM »
I don't see any on focus events on listbox2.  In testing, the only thing in my perform code was this:

LISTBOX2_CLICKED:
MSGBOX "OK"
RETURN

Nothing worked to get LISTBOX2 perform code to run with a single click.  But then you got me thinking to try turning Auto signal off on listbox2.  I did that and single click works.  But then only double clicks work afterward.  So I added this in the perform code:

LISTBOX2.CTL'Auto=1

And now single click works first time and each time after. So I now have listbox2 Auto signal unchecked as default in attributes setup, which gets single click to work on the first try, and then I turn auto on with the above code.  Single click now works first and each time after.

Didn't need to do this with Listbox1, it's set default Auto on.

It's working now so I will leave as is.