Thread Tools Display Modes
09-28-20, 08:11 AM   #1
Lindrin
A Defias Bandit
 
Lindrin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 3
Ace3 Options Input Disable Button

Hello,

I have something like this:

Lua Code:
  1. ...
  2. local options = {
  3.     type = 'group',
  4.     args = {
  5.         message = {
  6.             name = Barker.L['LABEL_MESSAGE'],
  7.             desc = Barker.L['DESC_MESSAGE'],
  8.             type = 'input',
  9.             order = 2,
  10.             get = function() Options:GetMessage() end,
  11.             set = function(...) Options:SetMessage(...) end
  12.         }
  13.     }
  14. }
  15.  
  16. function Options:OnEnable()
  17.     Config:RegisterOptionsTable(PANEL_NAME, options)
  18.     CR:RegisterOptionsTable(AddOnName, options)
  19.     CD:AddToBlizOptions(PANEL_NAME, Barker.L['LONG_TAG'])
  20. end

How do I disable the 'okay' button for the message input?

I've tried setting disableButton to true in the options table and accessing the widget via ...message.widget: DisableButton(true). The first complains about an unknown arg and the second says widget is nil.
  Reply With Quote
09-28-20, 11:20 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Why do you want it disabled? Do you only want users to enter in a message of a certain type? If so, see the usage and pattern fields. https://www.wowace.com/projects/ace3...bles#title-3-2

/edit: even if you disabled it, they could always hit "Enter" instead of clicking it.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-28-20, 11:23 AM   #3
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Originally Posted by Lindrin View Post
How do I disable the 'okay' button for the message input?
You can only disable the entire control when using an options table.
Code:
		message = {
			name = Barker.L['LABEL_MESSAGE'],
			desc = Barker.L['DESC_MESSAGE'],
			type = 'input',
			order = 2,
                        disabled = function() return true end,
			get = function() Options:GetMessage() end,
			set = function(...) Options:SetMessage(...) end
		}
  Reply With Quote
09-28-20, 03:38 PM   #4
Lindrin
A Defias Bandit
 
Lindrin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 3
Why do you want it disabled?
It's a usability thing. There's several inputs that are required before the user can hit a 'submit' button. I have a button that's disabled until those values are set. Having the text field pop up an 'okay' button is really misleading.

Do you only want users to enter in a message of a certain type?
No. For this we can say it can be any arbitrary text.

even if you disabled it, they could always hit "Enter" instead of clicking it.
That's true and I can have that handler just does nothing when the user hits enter but it's misleading and bad UX to have two 'okay' buttons.

You can only disable the entire control when using an options table.
That's unfortunate. I don't want the entire widget to be disabled. Only the 'okay' button to not appear when typing. There's no way to access the widget when using an options table so I can call DisableButton(true) on it?

Last edited by Lindrin : 09-28-20 at 03:45 PM.
  Reply With Quote
09-29-20, 11:48 AM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
No. It is part of the editbox widget in AceConfig. If AceConfig doesn't fit your needs, you can always create your own UI manually using AceGUI or your own code.

(FYI- AceConfig is just a layer on top of AceGUI to more easily facilitate the creation of and to standardize options windows.)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Ace3 Options Input Disable Button

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off