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
headerStringDialog header text
contentComponentBody content
canCancelbooleanfalseShows a Cancel button
canRejectbooleanfalseShows a Reject button
rejectTextStringLabel for the Reject button
confirmTextStringLabel for the Confirm button
openedConditionStringJavaScript condition controlling visibility
confirmActionIdStringAction fired when the user confirms
rejectActionIdStringAction fired when the user rejects
cancelActionIdStringAction fired when the user cancels
styleStringInline CSS
cssClassesStringCSS 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);
};
}