17.3.2.4.4.1.1. Additional API methods

The Loginapp REST UI SDK provides methods to adapt the layout to page events:

class MyCustomLayout extends iam.api.types.CustomLayout { 
  
    // Invoked whenever the layout is active and a new page is entered/navigated to 
    onPageEnter() { 
        // ... 
    } 
  
    // Invoked whenever the layout is active and a page is left 
    onPageExit() { 
        // ... 
    } 
  
    // Invoked upon language change 
    onLanguageChange(language) { 
        // ... 
    } 
  
    // Additional HTML rendering that cannot be done using header/footer/content. 
    // Note that this method can be used in combination with methods headerHtml, footerHtml and contentHtml. 
    // Caution: this method can be invoked more than once on a page: 
    // when entering a page, but also every time when switching the language. 
    // For a correct behavior, it must therefore be ensured that previous renderings are undone. 
    render () { 
        // ... 
    } 
}
…Show more…Show less

Note that equal API methods are first invoked on the layout and subsequently on the custom page. For example, onPageEnter() is invoked for all applicable layouts and afterward onPageEnter() is invoked for all applicable custom pages.