NetTalk Central

Author Topic: Disable insert button?  (Read 4539 times)

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Disable insert button?
« on: April 02, 2022, 03:57:35 PM »
I think I'm probably missing something obvious.

I want to conditionally disable the Insert button.  The template appears to support doing that, but it removes the button altogether rather than disabling it (pic).

Setting the "Disabled IF" condition on a regular button placed as a field on a form tab works as expected.

I can OMIT() template code and write my own routine to make it work on a browse, but am I misinterpreting the template option's intent?

edited to add:  nt 12.38
 
Jane



« Last Edit: April 02, 2022, 07:44:45 PM by Jane »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Disable insert button?
« Reply #1 on: April 03, 2022, 11:20:00 PM »
It's a bug. That disable was being applied to the small inline button, not the button underneath.
I'll fix that for the 12.39 build.

Incidentally note that the "disable" is only a visual thing. The user could still use the developer console to enable the button, and then add a record...

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Disable insert button?
« Reply #2 on: April 04, 2022, 08:06:28 PM »
LOL...  I never use the row insert buttons so that never occurred to me...

Thanks, Bruce.

This is not a high-security item.  Rather, I don't want someone creating an audit record for a date that has not yet come.  Instead of removing the button I decided to leave it tantalizingly in view but disabled, with a message saying that the future will come in its own time.

Just because I'm a jerk, and I can...    :o

A fix would be nice but I just added my own logic to set the flag in the call to CreateStdBrowseButton.

BTW... this may be intentional but it seems that the [Start of "Set jQuery Update Buttonset Options" Priority 5000] embed in the GenerateUpdateButtonsAbove and GenerateUpdateButtonsBelow routines share code.  Put something in one, close and open the procedure, and the code appears in the other one as well.

Cheers,

Jane

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Disable insert button?
« Reply #3 on: April 05, 2022, 03:30:51 AM »
that is indeed intentional.

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Disable insert button?
« Reply #4 on: April 05, 2022, 08:40:31 PM »
that is indeed intentional.

Makes sense that it would be since both routines are doing almost the same thing.  It just surprised me because I was using that embed for part of the OMIT to substitute my own code and noticed that the end of the omit wound up in both places.


Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Disable insert button?
« Reply #5 on: April 10, 2022, 06:31:05 PM »
Thanks for the 12.39 fix.