This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Knowledge Base
- :
- How to Disable or Hide Buttons on a Custom Code Panel
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
How to Disable or Hide Buttons on a Custom Code Panel
How to Disable or Hide Buttons on a Custom Code Panel
Summary
A custom code panel can be set to disable or hide its shown buttons using the Custom Code API.Synopsis
A custom code panel can be set to disable or hide its shown buttons using the Custom Code API.Discussion
It is possible to specifically set whether a button on a Custom Code Panel should be enabled and clickable or disabled and displayed as inactive. It is also possible to exclude a button from a panel entirely.Every custom code panel, by default, will include the Cancel, Previous, and Next buttons in an enabled state. In order to hide or disable the buttons, the GUIAccess interface from com.zerog.ia.api.pub exposes the following methods:
- setExitButtonEnabled(Boolean)
- setExitButtonVisible(Boolean)
- setNextButtonEnabled(Boolean)
- setNextButtonVisible(Boolean)
- setPreviousButtonEnabled(Boolean)
- setPreviousButtonVisible(Boolean)
Each method is self-explanatory where a ?True? argument sets the button as enabled or visible accordingly. The most important detail to note, however, is that the above methods must be called from within panelIsDisplayed rather than from within setupUI. The following example code details several of the above methods. Specifically, the custom code panel will have a disabled cancel button and an invisible previous button.
import com.zerog.ia.api.pub.CustomCodePanel; import com.zerog.ia.api.pub.CustomCodePanelProxy; import com.zerog.ia.api.pub.GUIAccess; public class DisableAndHideButtons extends CustomCodePanel{ private static final long serialVersionUID = -4037006515245501814L; @Override public boolean setupUI(CustomCodePanelProxy cccp) { return true; } @Override public void panelIsDisplayed(){ GUIAccess gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class); gui.setExitButtonEnabled(false); gui.setPreviousButtonVisible(false); } }
Additional Information
The Custom Code API javadoc can be found within the InstallAnywhere installation directory inside of the javadoc folder.
0% helpful
(0/1)