Disabling Command Definition buttons

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
ESODevKJ
Posts: 18
Joined: Tue Nov 10, 2020 9:07 am

Disabling Command Definition buttons

Post by ESODevKJ » Fri Apr 02, 2021 8:55 am

Hi All,

I need to disable the command definition buttons at the top of an instance list. I used this code:

Code: Select all

#avframeworkmanager.avChangeCommandState Objectname(#UOOBNM) Commandname('COMMAND_NEW') Enabled(false)
Image

which works, but when user clicks on an instance list column, the button becomes enabled.

Image

How do I make sure that this button stays disabled no matter what action the user performs?

Thanks in advance!

René Houba
Posts: 85
Joined: Thu Nov 26, 2015 7:03 am

Re: Disabling Command Definition buttons

Post by René Houba » Fri Apr 09, 2021 2:19 am

Hi,

This seems incorrect bahaviour to me.

So what you say is:
You disable the button with:
#avframeworkmanager.avChangeCommandState Objectname(#UOOBNM) Commandname('COMMAND_NEW') Enabled(false)

Which works.....

But when a user clicks on a column of the instance list, the new button becaomes Enabled(true)

ESODevKJ
Posts: 18
Joined: Tue Nov 10, 2020 9:07 am

Re: Disabling Command Definition buttons

Post by ESODevKJ » Fri Apr 09, 2021 3:51 am

I agree, and maybe I'm missing something, but that's what's occurring.

MarkD
Posts: 687
Joined: Wed Dec 02, 2015 9:56 am

Re: Disabling Command Definition buttons

Post by MarkD » Fri Apr 09, 2021 10:56 am

Could you clarify what you mean by the user clicking on an instance list column?

1. Do you mean the column heading?


2. Or do you mean on an item in the column which also causes the instance list ‘row’ (item) to become selected?

If it is the second option, then the act of selecting the instance list item would automatically enable all object and instance level commands for the business object.

e.g. If your New command is an object level command then this would cause it to become (re)enabled.

In that is what is happening you can probably solve it by executing the avChangeCommandState method again in the command handler that is executed when the user clicks on the item.

René Houba
Posts: 85
Joined: Thu Nov 26, 2015 7:03 am

Re: Disabling Command Definition buttons

Post by René Houba » Mon Apr 12, 2021 6:28 am

Good point Mark ;-)

ESODevKJ
Posts: 18
Joined: Tue Nov 10, 2020 9:07 am

Re: Disabling Command Definition buttons

Post by ESODevKJ » Mon Apr 12, 2021 11:09 pm

Thanks all for the input. I ended up modifying the avcheckauth routine in the IIP to just not have the commands shown if there was no security clearance for user.

Post Reply