public class DashboardController extends Object implements Serializable, ComplexCalculationResult
| Modifier and Type | Class and Description |
|---|---|
class |
DashboardController.ControllerItem |
static class |
DashboardController.ControllerItemType |
| Constructor and Description |
|---|
DashboardController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBackendCall(String label,
String apiUrl)
Performs a backend call in the user's context (i.e.
|
void |
addBackendCall(String label,
String apiUrl,
String payload)
Performs a backend call in the user's context (i.e.
|
void |
addBackendCall(String label,
String apiUrl,
String payload,
String successMessage,
String failMessage)
Performs a backend call in the user's context (i.e.
|
void |
addButton(String label,
String targetPage)
Adds a button to the controller
|
void |
addButton(String label,
String targetPage,
Object targetPageState)
Adds a button to the controller
|
void |
addButton(String label,
String targetPage,
Object targetPageState,
Object componentId)
Adds a button to the controller
|
void |
addHTML(String html)
Adds a HTML snippet into the controller
|
List<DashboardController.ControllerItem> |
getItems() |
String |
getResultType() |
public String getResultType()
getResultType in interface ComplexCalculationResultpublic List<DashboardController.ControllerItem> getItems()
public void addButton(String label, String targetPage)
label - The label of the buttontargetPage - The name of the target page. Hint: This is also displayed in the URL after the hash symbol
Sample code:@code
def controller = api.newController()
controller.addButton("1. STEP: Go to Live Price Grids","priceGridPage")
public void addButton(String label, String targetPage, Object targetPageState)
label - The label of the buttontargetPage - The name of the target page. Hint: This is also displayed in the URL after the hash symboltargetPageState - A extra parameter that is used for deep links. E.g. a typed id to open a specific page
Sample code:@code
def controller = api.newController()
controller.addButton("2. STEP: Go to LPG ABC","priceGridPage","45.PG")
public void addButton(String label, String targetPage, Object targetPageState, Object componentId)
label - The label of the buttontargetPage - The name of the target page. Hint: This is also displayed in the URL after the hash symboltargetPageState - A extra parameter that is used for deep links. E.g. a typed id to open a specific pagecomponentId - Some UI actions require a parameter in this field (e.g. opening a specific dashboard)
Sample code:@code
def controller = api.newController()
controller.addButton("Open Dashboard","dashboardPage",null,"FirstDash")
public void addBackendCall(String label, String apiUrl)
label - The label of the buttonapiUrl - The URL to call
Sample code:@code
def controller = api.newController()
controller.addBackendCall("Calculate LPG","/pricegridmanager.calculate/45")
public void addBackendCall(String label, String apiUrl, String payload)
label - The label of the buttonapiUrl - The URL to callpayload - The POST data to send along with the requestpublic void addBackendCall(String label, String apiUrl, String payload, String successMessage, String failMessage)
label - The label of the buttonapiUrl - The URL to callpayload - The POST data to send along with the requestsuccessMessage - A text that should be displayed in case of a successful response from the backendfailMessage - A text that should be displayed in case of a error response from the backend
Sample code:@code
def controller = api.newController()
controller.addBackendCall("Calculate LPG","/pricegridmanager.calculate/45",null,"OK","Not OK")
public void addHTML(String html)
html - The html snippet
Sample code:@code
def controller = api.newController()
controller.addHTML("Welcome to Price f(x)
")
Copyright © 2017. All rights reserved.