Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 397664

Summary: How to enable/disable buttons on new dialogs (orion/webui/dialog)
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: susan
Version: 2.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Szymon Brandys CLA 2013-01-08 06:49:13 EST
I have a dialog with a button added using buttons variable. I would like to enable it, only when some proper values are set on the dialog.
There is no API to do this. I see these buttons have no ids I could use neither.
Comment 1 Susan McCourt CLA 2013-01-08 09:53:53 EST
Would binding the buttons to a variable work?  We could have an id field in the button description.
Comment 2 Szymon Brandys CLA 2013-01-08 10:09:56 EST
(In reply to comment #1)
> Would binding the buttons to a variable work?  We could have an id field in
> the button description.

I thought exactly about something like that :)
Comment 3 Susan McCourt CLA 2013-01-08 11:29:07 EST
Fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f0e914a2c9b1dd7503903bc817a4b1d70fcde7a7

Things to know.

1) when something is disabled, set its class to this.DISABLED (defined in Dialog).
2) check this.$myButton.classList.contains(DISABLED) when you get the click.

See ImportDialog for an example.