Docs / API / Front

Front

com.s8.meta.api.front

The front is a native-style UI API whose objects are transmitted and rendered in the distant browser. You create objects on the server. The stack mirrors them to the screen.

S8FrontSession

createVertex(typeName, object)
Called for you from the S8FrontObject constructor. S8FrontVertex createVertex(String typeName, S8FrontObject object)

S8FrontObject

Base type of every object that can populate the front. Holds a final vertex.

S8FrontObject(front, typeName)
Creates the vertex and assigns this object to it. The typeName must match the front schema (and typically @S8ObjectType.name).

S8FrontVertex

expose(slot)
Publish this object into an exposure slot (slot 0 is the usual root of the page).
outbound()
Server → browser field updates: setBool8Field, setStringUTF8Field, setObjectField, lists, arrays.
inbound()
Browser → server method dispatch: setVoidMethod, setStringUTF8Method, plus *MethodLambda helpers that auto-refresh().
providers()
Raw resource providers for generated bytes (images, files).

Functions vs lambdas

Functions receive (S8SyncFlow flow, …) and may throw S8FlowException. You decide when to refresh().

Lambdas receive only the argument. The inbound wrapper runs operate then flow.refresh().

HomeScreen.java
@S8ObjectType(name = "app.HomeScreen")
public class HomeScreen extends S8FrontObject {
  public HomeScreen(S8FrontSession front) {
    super(front, "app.HomeScreen");
    vertex.inbound().setStringUTF8Method("onSubmit", (flow, value) -> {
      // full control, including when to refresh
      flow.refresh();
    });
    vertex.inbound().setVoidMethodLambda("onReady", () -> {
      // operate + auto-refresh
    });
  }
  public void setTitle(String title) {
    vertex.outbound().setStringUTF8Field("title", title);
  }
}
types.java
// Function interfaces live under com.s8.meta.api.front.functions.*
// Lambda interfaces live under com.s8.meta.api.front.lambdas.*
// Families: Void, Bool8, UInt8/16/32/64, Int8/16/32/64,
// Float32/64, StringUTF8, matching arrays, Object, ObjectsList.
Intent If you would call a setter on a desktop widget, call it on vertex.outbound(). If you would register a click handler, register it on vertex.inbound().