cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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.
Labels (1)
Was this article helpful? Yes No
0% helpful (0/1)
Version history
Last update:
‎Nov 12, 2018 05:39 PM
Updated by: