PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Disabled dropbox items  (Read 1851 times)

Sebastiaan Fisscher

  • Silver Member
  • ***
  • Posts: 23
    • View Profile
    • Astecom Business Software
Disabled dropbox items
« on: August 09, 2018, 08:57:28 AM »
Sometimes a user should be able to see the choice in a dropbox, but not be able to choose that option.
It could be that the choice needs to be in there for historic purposes or that a combination of settings allows it to be seen but not chosen.

Could it be possible build in a feature that disables dropbox choices?

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Disabled dropbox items
« Reply #1 on: August 09, 2018, 10:26:24 AM »
While in theory it could be done, a user might get the impression he/she can select an item and then it does not change they may report it as a bug in the application.

My suggestion would be for the drop box simply assign logic executes something like this:

  • On DB1 Post_create
    db1_fix$=db1$
  • On DB1 Selection event:
    if db1$<>db1_fix$ msgbox "Only selection of "+db1_fix$+" allowed at this time."; db1$=db1_fix$; change_flg--
This would enable the drop box but prevent the user from changing the value while letting them know why their selection is being rejected. 

In addition the logic could easily be made conditional so that only in certain conditions the user would be allowed to change the value -- for example when creating new record but not changeable when viewing existing records.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Sebastiaan Fisscher

  • Silver Member
  • ***
  • Posts: 23
    • View Profile
    • Astecom Business Software
Re: Disabled dropbox items
« Reply #2 on: August 10, 2018, 06:21:28 AM »
I know it's possible to to check which option was chosen and to compare it to options that are not allowed to choose, we already use this in certain cases.
I have had multiple clients come up with the question if this could be addressed, because they think it's annoying that they can choose the forbidden option in the first place.

If it's theoretically possible then the forbidden option could be greyed out, like disabled controls work as well.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Disabled dropbox items
« Reply #3 on: August 10, 2018, 09:24:39 AM »
In order to accomplish what you want you would need some way to identify which selections are not allowed.  That could get very complex in the Nomads designer and even the list LOAD directive. 

To make this easier to define we could add a property where you could indicate the leading character for non-selectable items such as 'DisabledPrefix$ = "~" then any list item that starts with ~ would not be selectable and the ~ would be suppressed.   This approach would make is easier to load and define in Nomads.

I however am still not certain this might cause more problems from a support perspective not to mention having to see how it could be implemented in iNomads on Tablets where drop boxes are presented as a overlaid list on the screen and not as a drop down list.  I'm not certain we have any control over the display in this case.

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