Implementing gui_init
The gui_init function is called during initialization of the application and provides the form definition.
In this section the calling syntax, arguments and return values will be discussed, followed by a small example.
Syntax
def gui_init(meta_data: dict) -> dict:
...
return payload
function payload = guiInit(metaData)
...
end
Arguments
meta_data:
Meta data describing the client session.
Dict/struct with fields:
session_id: unique ID for the session, can be used to differentiate between multiple instances of the applicationnamespace: package name of the applicationapplication_data: The application data dictionary / struct. Contains the fields and values set by the Portal or local run call.mode:localordeployedclient_data:authenticated_user: for deployed apps, the portal provides the logged on user infouser_displayname: user name for printing (e.g. "John Smith")username: unique identifier used by the authentication protocol
In the gui_init function, form is defined by filling the form field of the payload.
The payload is then sent to the front-end in order to present the form to the user.
payload:
Return value with the form definition.
Dict/struct with fields:
form: asimian.gui.Formnavbar(optional): dict/struct with fields:logo(optional): image source reference (anything that can be put in HTML<img src="..." />)title(optional): HTML stringsubtitle(optional): HTML string
See also
- For an example see Hello world!.