SetTransferAttributes function

Syntax

SetTransferAttributes(enable_animation, [add_to_history], [back_label], [user_data], [qry_string_array])

Description

Use the SetTransferAttributes function to set certain transfer-related properties when executing a transfer to a different page or component. SetTransferAttributes can be invoked prior to the transfer (for example, in a FieldChange program) or after the transfer in the target component (for example, in a page Activate program).

Parameters

Parameter Description

enable_animation

Specifies a Boolean value indicating whether to animate the transfer.

The default value is False.

add_to_history

Specifies a Boolean value indicating whether to track the transfer in the Back button history stack.

The default value is True.

Note: The Back button is a user interface widget that appears in the portal header of classic pages and in the fluid page banner; it is not the browser’s back button.

back_label

Specifies a custom label for the Back button as a string value.

user_data

Specify any additional transfer attributes as name/value pairs using the following format:

Name1@Value1;Name2@Value2;...;NameN@ValueN

Specify the empty string, "", when no additional attributes need to be set.

Use the returntolastpage attribute to specify which page is displayed when returning to this component via the Back button:

  • returntolastpage@0 — The Back button returns the user to the first page of the component. This is the system default behavior for components.

  • returntolastpage@1 — The Back button returns the user to the last viewed page of the component.

The returntolastpage attribute overrides any page navigation settings specified in Application Designer. For fluid components, this is set on the Fluid tab; see Fluid User Interface Developer’s Guide: Setting Properties on the Fluid Tab. For classic components, this is set on the Internet tab; see Application Designer Developer’s Guide: Setting Internet Properties.

qry_string_array

Specifies an array of array of string containing name/value pairs to be used as query string parameters constituting the history record.

Returns

None.

Example

The following example sets animation to true, keeps the current content in the history, sets the back button's label to "Search Results," and then invokes the Transfer built-in function to complete the transfer:

SetTransferAttributes( True, True, "Search Results");
Transfer( False, MenuName.QE_NUI, BarName.USE, ItemName.QE_NUI_ED_BOOK, Page.QE_BOOK, "U", QE_BOOK.QE_BOOK_NAME);

The following example sets and uses an array of array of string containing name/value pairs to be used as query string parameters constituting the history record and then invokes the ViewURL built-in function to complete the transfer:

import EP_FUNCTIONS:DocumentPageTitle;
import EP_NUI_FUNCTIONS:EEmasterlist;
...
Component EP_NUI_FUNCTIONS:EEmasterlist &Component_MasterList;
...
SQLExec(SQL.EP_SEL_ROLE_DESCR, &EP_GBLKEYS_WRK.EP_ROLE.Value, &RoleDescr);
&Gbl_PageTitle = GetText("APPR_MAIN1_TITLE", " ", " ", " ", &EP_GBLKEYS_WRK.EP_USER_ROLE.Value, " ", &RoleDescr, " ", " ", " ", " ");
&Cmp_PageTitle = &Gbl_PageTitle;

/*  Transfer to WorkCenter  */
Local array of array of string &qs = CreateArray(CreateArray("XFER_TAB_NUMBER", String(&Component_MasterList.GetTabNumber())));
SetTransferAttributes( False, True, "", "", &qs);

&url = GenerateComponentPortalURL(%Portal, %Node, MenuName.ROLE_EMPLOYEE, "GBL", Component.EP_APPR_MAIN, "", "");
&EndPos = Find("?", &url, 0);
If &EndPos = 0 Then
 		&url = &url | "?replaceCurrentTopWindow=y&cmd=uninav";
Else
 		&url = &url | "&replaceCurrentTopWindow=y&cmd=uninav";
End-If;

rem %Response.RedirectURL(&url);
ViewURL(&url);

In certain scenarios, you may require intermediate components to perform a contextual transfer to content such as a dashboard. In these scenarios, you must prevent tracking of the intermediate component in the Back button history stack. To do so, the following code can be used in the intermediate component:

SetTransferAttributes( False, False, "", "", null, True);
ViewURL("http://domain:port/psp/ps_7/EMPLOYEE/T55106RO/h/?tab=QE_PT_DASHBOARD&pslnkid=QE_PT_DASHBOARD_LINK");