PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Radio Button Logic  (Read 2056 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Radio Button Logic
« on: August 23, 2018, 02:28:26 PM »
I'm setting up a panel with a set of Radio Buttons to control which Tab on a Tabless Folder to use. I've included a Perform routine for the RB's "When Receiving Focus" logic, but it never seems to execute. (ESCAPE as first statement doesn't happen.)
Is there something I'm missing?
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Radio Button Logic
« Reply #1 on: August 23, 2018, 02:44:37 PM »
Events are only associated with primary radio button of a group -- that is index 1.

In addition the FOCUS event treats the focus to any of the radio buttons in the group together, that is it fires the logic assigned to the on focus logic of the primary button when any button gets focus HOWEVER changing focus from button to button within the group is not fire an on focus event.

So for example if I have three radio buttons:

(o) Visa
(o) MasterCard
(o) Amex

If I put focus from any control outside of the radio button group to any of the radio buttons I will get the on focus event, but if once in group and focus is for example on Visa, changing focus to Amex or MasterCard will no fire an on focus event.

All buttons in a radio button group are considered as a single control.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Re: Radio Button Logic
« Reply #2 on: August 23, 2018, 03:55:54 PM »
Mike:
I've got that much down; thanks.
The problem I'm encountering is that when I tab into the RB group, the On Focus doesn't fire.
Perhaps it ties into the tabless folder. Tabbing out of the last control on the tab is supposed to go to the RB group. It seems, however, to ignore any remaining (non-visible) tabs, returning to the first defined tab (which is an empty page, and that's OK). The focus then lands on the RB group, with the last selected entry highlighted.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Re: Radio Button Logic
« Reply #3 on: August 28, 2018, 09:56:36 AM »
Even after cleaning up the double-processing of the turning off the RB's (see https://forum1.pvxplus.com/index.php?topic=150.0), I still can't seem to get the When Receiving Focus logic to fire (msgbox "Pre-Op"; perform ...).

NOMADS panel on PxPlus 13.10 on RedHat Linux.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Radio Button Logic
« Reply #4 on: August 28, 2018, 10:28:20 AM »
I tried this here with a Radio Button group "after" the folder and I got the Focus event (tabbed or tabless)
I also tried this with a radio button group on another tab and it too seemed to work.

I created a panel with a folder with a radio button group just after the folder then added two sub-panels to the folder.  The radio button group had an On Focus event to execute PRINT "Focus".
When I pressed tab on the last control on any of either sub-panel focus went to the radio button group outside of the folder and printed "Focus" on the panel.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Radio Button Logic
« Reply #5 on: August 29, 2018, 02:03:02 PM »
Just an update on this issue.  We got access to the panel James was having trouble with and noticed that a non-primary radio button (a button with an index other than one) had different On Focus logic associated with it.  This logic overrode the logic associated with the primary button (index 1) of the radio button group.

This type of situation can happen by creating a radio button, assigning logic to it, then using CTRL-D (or copy/paste) to duplicate it.  If you then rename this duplicate button back to the original group and set its index to some other value the system leaves the original logic on the duplicate button and it ends up overriding the primary buttons logic.  As this duplicate button is not index 1 you cannot edit/view the logic assignments in the Nomads designer.

We have added logic for PxPlus 2019 to avoid this from happening in the future.


Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com