Show/Hide Toolbars

Use XML files to create custom screens and tools. The XML file includes the structure, layout, and contents of a custom block. If the screen or tool has complex business requirements or if data is pulled from related records, you can use a Custom Java Block (CJB). The CJB uses the TeamConnect API to specify actions and properties for the custom block.

Note: You do not need a CJB if the page is only referencing system fields or existing custom fields or you just want to display plain HTML.

When implementing a CJB, stay within the following JavaBean conventions:

The get method signature—public PropertyType getPropertyName() or public boolean isPropertyName()

For example:

public String getName();

public boolean isActive();

The set method signature—public void setPropertyName(PropertyType value)

For example:

public void setName(String name);

public void setActive(boolean isActive);

Service and Model Classes

When you add a custom screen or tool to an object, you create page sections. When custom page requires information, access the associated service classes and call specific model methods in the CJB.

For custom screens only, because the underlying record is already available to the CJB because of the getRecord() method, you do not need to use the read() method in the record service class to access the record. If you need to access a different record of the same type, then you access the service class. For example, if you create a contact record as part of the screen, access ContactService in the code to use the create() method.

Note: If you want to perform some initialization when TeamConnect first loads a screen or tool, you must override the initialize() method. For example, if you want to access the page arguments that launch a wizard, you can use the initialize() method to access them.

OnClick and OnChange Functions

If the custom block includes a CJB, you execute actions in the CJB from the XML file using the following functions:

invokeCustomAction—Use in custom screen XML files.

invokeToolAction—Use in custom tool XML files.

Use these functions for onClick and onChange events. For example, you can use the invokeCustomAction function to execute an action when a user clicks a button in a screen, as shown in the following sample:

<input type="button" value="Execute action1" onClick="invokeCustomAction(this, 'cjb', 'action1', 'hi', 1, true)" />

In the previous sample, invokeCustomAction takes the following parameters:

this—The first parameter of these functions in all custom XML files.

'cjb'—The ID of the CJB defined in the XML file.

'action1'—The name of the Java method in the CJB.

'hi', 1, true—Arguments that the action uses.

If this button was in a custom tool, the parameters of the invokeToolAction function would include the following two parameters:

'action1'—The name of the Java method in the CJB.

'hi', 1, true—Arguments that the action uses.