Blog Viewer

JavaScript Hooks

  

To use a JavaScript hook in S3, you call it in the relevant C# object. These are the available hooks.

 

UI Template Hooks:

BeforeShowDiv

  • What it does: Hook to decide whether the current DIV/form should be displayed. If returned false, it will not display.
  • Return Type: Boolean.



ShowDivCallBack

  • What it does: Hook called after displaying the current form/DIV.
  • Return Type: N/A.



AfterApplyingUI

  • What it does: Hook for initializing all controls and before binding data to controls.
  • Return Type: N/A.



CanPositionCursor

  • What it does: Hook to set focus on a particular control when the form opens. If false, then the form opens without focusing on any control.
  • Return Type: Boolean.



ChangeDialogPanelTitle

  • What it does: Hook to change the dialog title. It returns the changed title.
  • Return Type: String.



HideFreezeCrumToolbar

  • What it does: Hides the CrumToolbar if false.
  • Return Type: Boolean.



AddToLookUpNames

  • What it does: Hook to decide whether to display form titles for Maintenance as lookup forms. If true, the title will display.
  • Return Type: Boolean.



DisplayBreadCrumbs

  • What it does: Hook to decide whether to display breadcrumbs. If false, breadcrumbs will not display.
  • Return Type: Boolean.



GetLoadBreadCrumbsUserTemplate

  • What it does: Hook for getting the breadcrumb HTML. If returned as an empty string, the framework will prepare the breadcrumb HTML.
  • Return Type: HTML string.



GetDirtyFormUserTemplate

  • What it does: Hook to customize the HTML dirty form list that displays in the top header. If returned as an empty string, the framework will prepare the HTML.
  • Return Type: HTML string.



ApplyClientVisibility

  • What it does: Applies client visibility based on the returned boolean value.
  • Return Type: Boolean.



Message Related Hooks:

ChangeDisplayError

  • What it does: Returns the changed error message.
  • Return Type: String.



ChangeDisplayMessage

  • What it does: Returns the changed display message.
  • Return Type: String.



ChangeReadOnlyReason

  • What it does: Returns the changed readonly reason message.
  • Return Type: String.



Data Binding Hooks:

AfterBindFormData

  • What it does: Hook for after binding the data to controls.
  • Return Type: N/A.



AfterBindDialogData

  • What it does: Hook for after binding the data to dialog controls.
  • Return Type: N/A.



AfterBindSchedulerDialogData

  • What it does: Hook for after binding scheduler data on dialog.
  • Return Type: N/A.



Chart Related Hooks:

GetChartTitle

  • What it does: Hook for custom chart title for nvd3 chart.
  • Return Type: String.



PieChartSeriesClick

  • What it does: Hook for clicking the pie chart series. If returned false, further execution will not happen.
  • Return Type: Boolean.



BarAndLineSeriesClick

  • What it does: Hook for clicking the bar and line chart series. If returned false, further execution will not happen.
  • Return Type: Boolean.



GetChartMaxMinValue

  • What it does: Hook for maximum and minimum limit for nvd3 chart Y axis.
  • Return Type: JSON object.

PieChartLabelRenderer

  • What it does: Hook to set the nvd3 pie chart label type as percentage or others.
  • Return Type: Boolean.



XAxisRenderWhereXAxisRenderIsAttributeValueOfsfwXAxisRenderFun

  • What it does: Hook to set the nvd3 x axis render function.
  • Return Type: Function.



YAxisRenderWhereYAxisRenderIsAttributeValueOfsfwYAxisRenderFun

  • What it does: Hook to set the nvd3 y axis render function.
  • Return Type: Function.



XAxisFormatFunWhereXAxisRenderIsAttributeValueOfsvwXAxisFormatFun

  • What it does: Hook to set nvd3 chart x axis type/checked format (example: linear, category, date, etc.).
  • Return Type: N/A.



YAxisFormatFunWhereYAxisRenderIsAttributeValueOfsfwYAxisFormatFun

  • What it does: Hook to set nvd3 chart y axis type/checked format (example: linear, category, date, etc.).
  • Return Type: N/A.



File Upload Hooks:

FileUploadSuccess

  • What it does: Hook that is called after a successful upload.
  • Return Type: N/A.



AddCustomFileExtensions

  • What it does: Hook for adding custom file extensions.
  • Return Type: N/A.



FileUploadException

  • What it does: Hook that is called if there is any error while uploading a file.
  • Return Type: N/A.



ValidateSelectedFiles

  • What it does: Hook for custom validations of uploaded files. If returned false, the file is invalid.
  • Return Type: Boolean.



CustomMethodNameWhereCustomMethodNameIsAttributeValueOfUploadClickForFileUploadControl

  • What it does: Hook that is called upon clicking File Upload. If returned true, the file will be submitted.
  • Return Type: Boolean.



CustomMethodNameWhereCustomMethodNameIsAttributeValueOfOnSelectForFileUploadControl

  • What it does: Hook for file selection.
  • Return Type: N/A.



Navigation Hooks:

BeforeNavigate

  • What it does: Hook that is called for the following (if returned false, further execution will not happen):
    • For anchor tag as related control, before actually navigating to href value.
    • For btnOpenDetail_Click, btnOpen_Click, and btn_New Click.
    • For menu navigation.
  • Return Type: Boolean.



BeforeMenuNavigate

  • What it does: Hook that decides whether navigation will happen after clicking a menu item and attempting to navigate. If returned false, navigation will not happen.
  • Return Type: Boolean.



MenuClick

  • What it does: Hook that is called after navigating upon clicking a menu item.
  • Return Type: N/A.



NavigateToAlternateForm

  • What it does: Hook that is called while closing the MyBasket form and sets an alternate form to display.
  • Return Type: N/A.



OnBeforeDeleteNodeClick

  • What it does: Hook to decide whether the form is to be deleted. If returned false, the form will not be deleted.
  • Return Type: Boolean.



Wizard Hooks:

CustomizeWizardStep

  • What it does: Hook for any custom business logic to be executed after each wizard step displays.
  • Return Type: N/A.



WizardCancelClick

  • What it does: Hook that is called upon clicking added buttons in the wizard action toolbar. 
  • Return Type: N/A.



Formatting Hooks:

ExtendCustom

  • What it does: Hook that masks custom data formats.
  • Return Type: N/A.



Common Hooks:

OnMyTaskTabClick

  • What it does: Hook that is called upon clicking a tab item inside the My Task Basket container.
  • Return Type: N/A.



BeforePrintPage

  • What it does: Hook that is called before printing the page.
  • Return Type: N/A.



SetUnSavedFormIcon

  • What it does: Hook to decide whether to display the unsaved icon. If returned false, the unsaved icon will not display.
  • Return Type: Boolean.



RetainGridSelection

  • What it does: Hook for retaining grid selection.
  • Return Type: JSON String.



StoreGridSelection

  • What it does: Hook for storing grid selection.
  • Return Type: N/A.



GetCustomFrequencyOptions

  • What it does: Hook for changing drop down options in case of autorefresh.
  • Return Type: Object array with keys value and description.



SchedulerAfterEventAdded

  • What it does: Hook for changing event data.
  • Return Type: JSON object.



SchedulerCustomTooltip

  • What it does: Hook to set a custom scheduler tooltip.
  • Return Type: HTML string.



CustomAfterReportGenerated

  • What it does: Hook that is called after successfully generated a report.
  • Return Type: Boolean.



GetCustomReportParams

  • What it does: Hook for custom report parameters.
  • Return Type: JSON.



btnBPMReject_Click

  • What it does: Hook that is called after clicking BPM Reject and attribute Process ="True".
  • Return Type: N/A.



LogoutSession

  • What it does: Hook to log out session where the user can navigate to a custom logout page. If returned false, the system will not navigate to Account/Logout.
  • Return Type: Boolean.



ChangeSearchCriteriaOnOpenLookupFromBPM

  • What it does: Hook that changes search criteria when the user opens a lookup form from BPM, upon receiving response for WorkflowExecuteMethod action and multiple models received from server, and the current form is lookup.
  • Return Type: N/A.



OpenAllRecords

  • What it does: Hook that opens all selected records or only the one on which the link is clicked.
  • Return Type: Boolean.



CustomMethodNameWhereCustomMethodName=AttributeValueOfOnClientChangeProperty

  • What it does: Hook that is called when the user updates the value on a drop down, combobox, or multiselect control.
  • Return Type: N/A.



CustomMethodNameWhereCustomMethodNameIsValueOfAttributesfwMethodName

  • What it does: Hook that is called when a button is called whose base_click attribute is true and whose sfwMethodName is a custom method.
  • Return Type: Boolean.



CustomMethodNameWhereCustomMethodNameIsValueOfAttributesfwMethodName

  • What it does: Hook that is called before executing the framework code for any action whose OnClientClick attribute's value is the method name. If returned false or undefined, further execution will not happen.
  • Return Type: Boolean.



CallToBuildCenterLeftForms

  • What it does: Hook that calls BuildLeftForm during InitApp for CenterLeft forms.
  • Return Type: N/A.



ProcessAjaxCallResult

  • What it does: Hook that is called from the beginning of the callback function and after every successful async AJAX response from the server.
  • Return Type: N/A.



RaiseEventPostCallBackHandler

  • What it does: Hook that is called at the end of the callback function and after every successful async AJAX response from the server, if the action button does not have ExecuteAfterSucess control.
  • Return Type: N/A.



Application Initialization Hooks:

InitializeUserDefinedEvents

  • What it does: Hook to register custom events that is called only once while initializing the application.
  • Return Type: N/A.



SetLanguage

  • What it does: Hook that sets the language in case of multilingual support (ns.Language).
  • Return Type: String.



SetCustomResource

  • What it does: Hook that sets resources on the Master Pages or any other places that will be called only once at page load, in case of multilingual support.
  • Return Type: N/A.


This post is part of the Entity topic. Click here to open the Entity Overview.

0 comments
51 views

Permalink