GUI-Api goes FirstSpirit - Dialog Boxes inside the Client

MichaelaReydt
Community Manager
Community Manager
3 3 734

A common feature request amongst developers was to create interactive dialogs within the FirstSpirit JavaClient.

This request came true with the FirstSpirit 4.2 R4 release.

Code-Example for the Dialog Boxes stated below:

import de.espirit.firstspirit.agency.OperationAgent;

import de.espirit.firstspirit.ui.operations.RequestOperation;

// get operation agent

operationAgent = context.requireSpecialist(OperationAgent.TYPE);

// get request operation

requestOperation = operationAgent.getOperation(RequestOperation.TYPE);

// configure request operation

no = requestOperation.addAnswer("Oh, you better don't ask!");

waiting = requestOperation.addAnswer("Maybe, maybe not. Who knows?");

yes = requestOperation.addYes();

requestOperation.setInitialAnswer(waiting);

requestOperation.setKind(RequestOperation.Kind.ERROR);

requestOperation.setTitle("Happy Day");

// perform request to open dialog

result = requestOperation.perform("Are you okay?");

if (result == yes) {

    requestOperation = operationAgent.getOperation(RequestOperation.TYPE);

    requestOperation.perform("Oh, really? Then have a nice day ! 🐵 ");

}

Dialog Boxes for the given Code-Example

Start-Box:

box1.png

Result from clicking "Yes":

box2.png

API-Links:

3 Comments