Skip to content

ConfirmDialog

A pre-built confirmation dialog with a header, body text, and confirm/reject/cancel buttons wired to server actions.

ConfirmDialog.builder()
.header("Are you sure?")
.content(new Text("This will permanently delete the record."))
.confirmText("Yes, delete")
.confirmActionId("confirm_delete")
.build()
PropertyTypeDefaultDescription
headerString—Dialog header text
contentComponent—Body content
canCancelbooleanfalseShows a Cancel button
canRejectbooleanfalseShows a Reject button
rejectTextString—Label for the Reject button
confirmTextString—Label for the Confirm button
openedConditionString—JavaScript condition controlling visibility
confirmActionIdString—Action fired when the user confirms
rejectActionIdString—Action fired when the user rejects
cancelActionIdString—Action fired when the user cancels
styleString—Inline CSS
cssClassesString—CSS class names
ConfirmDialog.builder()
.header("Submit order?")
.content(new Text("You have 3 items in your cart totalling €89.97."))
.confirmText("Place order")
.confirmActionId("place_order")
.rejectText("Save for later")
.rejectActionId("save_cart")
.canReject(true)
.canCancel(true)
.cancelActionId("dismiss")
.build()
@Override
public Object handleAction(String actionId, HttpRequest request) {
return switch (actionId) {
case "place_order" -> { placeOrder(); yield new State(this); }
case "save_cart" -> { saveCart(); yield new State(this); }
default -> new State(this);
};
}