10.34 Binding Source

Description: This attribute is used to specify the use of the tag. For example, it can be used to display text, or some value or an icon etc.

Components to accept the input: Select box



This select box has five options:
  1. NLS: This option is used to display simple text. When user selects this option it will display an input box named as “Label” as shown in the image below.

  2. Bindings: This option is used to display value of some variable. When user selects this option it will display a select box named as “Value” as shown in the image below. To know more about value refer Value attribute section.

  3. Icon: This option is used to display an icon. When user selects this option, it will display an input box named as “Icon class name” as shown in the image below.

  4. After Renderer: This option is used to call a function after the DOM (Document Object Model) has rendered the specific HTML code. When user selects this option, it will display an input box named as “Enter Function Name” as shown in the image below. To know more about this refer https://knockoutjs.com/documentation/template-binding.html

Example:
  1. User wants to display simple text “Welcome” as shown in the image below.
    After Renderer

    Usage: As this is a simple text coming from Resource Bundle, select Type “NLS”.

    Enter “Welcome” text in the “Label” input box as shown in the image below.



  2. User wants to display “Welcome” which is stored in a variable.
    After Renderer

    Usage: Assume variable name is “tempVariable”. As this is stored in a variable and not coming from Resource Bundle, select type “Binding Source”.

    How to add a variable using Value attribute refer Value attribute section.



  3. User wants to display the user icon and password icon, highlighted in red oval in the image below.

    Usage: User icon class is “icons icon-user”.

    Select type “Icon”

    Enter the user icon class “icons icon-user” in the “Icon class name” input box as shown in the image below.



  4. User wants to execute some function once the specific elements are rendered on the screen.

    Usage: Assume function name is "display Success”.

    Select type “After renderer”

    Enter function name “display Success” in the “Enter Function Name” input box as shown in the image below.