Calls to Javascript methods in TeamConnect 2.x required referencing the "top" frame. However, in TeamConnect 3.x, 4.x and 5.x, frames do not exist. Thus, all references to the "top" frame must be removed in calls on Javascript functions and variables.
In 2.x and 3.x versions, you might see a reference to the submitCommand(...) and invokePageDetailAction functions, which allowed implementers the ability to call methods with or without parameters in page details, as shown in the following examples:
top.submitCommand('_self', 'anchor', 'PD', 'clickEntityCheck(*STR, *STR)', 'checkName', 'entityValue');
invokePageDetailAction(this, 'anchor', 'clickEntityCheck(*STR, *STR), 'checkName', 'entityValue');
top.submitCommand('_self', 'anchor', 'PD', 'generate()');
invokePageDetailAction(this, 'anchor', 'generate()');
While 3.x CJBs using the invokePageDetailAction continue to work, you can use the invokeToolAction function in any new 4.x and 5.x CJBs.
For example, the following examples execute a 4.x and 5.x tool action:
invokeToolAction('action')
invokeToolAction('actionWithArguments', arg1, arg2)
In addition to executing a 4.x and 5.x tool action, you can also indicate the HTML element for the code to focus on once the page reloads, as shown in the following examples:
invokeToolActionAndAnchor('anchor', 'action')
invokeToolActionAndAnchor('anchor', 'actionWithArguments', arg1, arg2)
In 2.x and 3.x versions, you might see a reference to the invokeBlockAction function, as shown in the following examples:
top.submitCommand('_self', 'anchor1', 'PD', 'invokeBlockAction(STR, STR)', 'invokeBlockActionCjb', 'argument');
invokeBlockAction(this, 'anchor1', 'invokeBlockActionCjb', 'argument');
While 3.x CJBs using the invokeBlockAction function continue to work, you can use the invokeCustomAction function in any new 4.x and 5.x CJBs.
For example, the following examples execute a 4.x block action:
invokeCustomAction(this, 'cjb', 'action')
invokeCustomAction(this, 'cjb', 'actionWithArguments', arg1, arg2)
In addition to executing a 4.x and 5.x block action, you can also indicate the HTML element for the code to focus on once the page reloads, as shown in the following examples:
invokeCustomActionAndAnchor(this, 'anchor', 'cjb', 'action')
invokeCustomActionAndAnchor(this, 'anchor', 'cjb', 'actionWithArguments', arg1, arg2)
All occurrences of top.didChange and top.didChangeText should be removed. In 2.x these are used to enable/disable buttons like Save, or Save & Close. In 3.x and 4.x these are no longer needed.
The tc:newRecordLink tag is a 3.x, 4.x and 5.x autoconversion of the 2.x Javascript method openPageWithKeyAndArgs(...).
For example:
<a onClick="top.openPageWithKeyAndArgs('NEW_PROJECT_WIZARD_OBJECT', '{ wizard = ADVICE; application = ADCO; isFromMatter=1; embeddedObject=RADC; parentKey = 3}');">
New Advice And Counsel
</a>
is converted by the automated conversion tool to newRecordLink tag:
<tc:newRecordLink entityCode="ADCO" entityToLink="${enterpriseEntity}" pageArgs="{ isFromMatter=1; embeddedObject="RADC"; parentKey = 3}" wizardUniqueKey="ADVICE">
New Advice And Counsel
</tc:newRecordLink>
Here is the conversion of attributes from openPageWithKeyAndArgs to tc:newRecordLink:
{ wizard = ADVICE; application = ADCO; isFromMatter=1; embeddedObject=RADC; parentKey = 3}
will become
pageArgs="{ isFromMatter=1; embeddedObject="RADC"; parentKey = 3}"
•application value is used as value for entityCode attribute.
entityCode="ADCO"
•wizard value is used as value for wizardUniqueKey attribute.
wizardUniqueKey="ADVICE"
•Other arguments become attribute values in pageArgs.
•New attribute entityToLink value should be set to ${enterpriseEntity}
In certain screens dynamic content is rendered by invocation of methods using tags.
The following code dynamically renders a call to openPageWithKeyAndArgs.
<tc:component componentType="WOString" value="${cjb.getWizardHref}" />
where getWizardHref() returns:
<a onClick="top.openPageWithKeyAndArgs('NEW_PROJECT_WIZARD_OBJECT', '{ wizard = ADVICE; application = ADCO; isFromMatter=1; embeddedObject=RADC; parentKey = 3}');">
New Advice And Counsel
</a>
In the previous example, tc:component can rewritten as the tc:newRecordLink tag in 3.x, 4.x and 5.x.
<CLProjectTitle..> conversion:
There is no equivalent tag for the 2.x <CLProjectTitle..> in 4.x and 5.x. This needs to be manually handled in the screens.
An equivalent title can be displayed by writing a method in the CJB:
public String getProjectTitle(){
return platform.getInternationalizationService().getObjectTitle(project);
}
...and then invoking that method in XML with the tc:out tag, like so:
<tc:out value="${cjb. projectTitle}"/>