Closed gmmars closed 3 days ago
Jmix version: 2.3.4 Jmix Studio plugin version: 2.3.3-242 IntelliJ version: IntelliJ IDEA 2024.2.4 (Ultimate Edition)
Weird behavior of enabled button in disabled container. Link to forum
Descriptor
<hbox width="100%" margin="false"> <button id="tglLayoutBtn" text="toggle layout"/> <button id="tglTestBtn" text="toggle button"/> </hbox> <flexLayout id="buttonLayout"> <button id="testBtn" text="test"/> </flexLayout>
Sample code
@Subscribe(id = "tglLayoutBtn", subject = "clickListener") public void onTglLayoutBtnClick(final ClickEvent<JmixButton> event) { boolean layoutEnabled = buttonLayout.isEnabled(); buttonLayout.setEnabled(!layoutEnabled); event.getSource().setText("layout is "+(!layoutEnabled?"enabled":"disabled")); } @Subscribe(id = "tglTestBtn", subject = "clickListener") public void onTglTestBtnClick(final ClickEvent<JmixButton> event) { boolean btnEnabled = testBtn.isEnabled(); testBtn.setEnabled(!btnEnabled); event.getSource().setText("testBtn is "+(!btnEnabled?"enabled":"disabled")); } @Subscribe(id = "testBtn", subject = "clickListener") public void onTestBtnClick(final ClickEvent<JmixButton> event) { notifications.show("Test Click!"); }
Enabled Button in disabled Container is displayed as enabled. But when you click it, nothing hapends. Despite the Button is displayed as enabled, calling isEnabled() returns False.
In addition, the enabled button(tglTestBtn) in the enabled layout(hbox) is also not handled when layout(buttonLayout) is disabled.
tglTestBtn
hbox
buttonLayout
Cannot reproduce on Jmix 2.4.1. But anyway this is not Jmix issue.
Environment
Jmix version: 2.3.4 Jmix Studio plugin version: 2.3.3-242 IntelliJ version: IntelliJ IDEA 2024.2.4 (Ultimate Edition)
Bug Description
Weird behavior of enabled button in disabled container. Link to forum
Steps To Reproduce
Descriptor
Sample code
Current Behavior
Enabled Button in disabled Container is displayed as enabled. But when you click it, nothing hapends. Despite the Button is displayed as enabled, calling isEnabled() returns False.