Class PreAction

java.lang.Object
org.cxbox.core.dto.rowmeta.PreAction

public class PreAction extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • confirm

      public static PreAction confirm()
      confirm with default title and auto-generated text

      title - default 'Are you sure?' title will be shown (actually its translation defined in Frontend i18n)
      text - will be auto-generated by backend from PreActionType.CONFIRMATION template.
    • confirm

      @Deprecated(since="4.0.0-M16", forRemoval=true) public static PreAction confirm(String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of release 4.0.0-M16, replaced by configurable confirm(cf -> cf.text("Changes will be saved")).

    • confirm

      public static PreAction confirm(@NonNull @NonNull UnaryOperator<PreActionConfirmBuilder.Cf> cf)
      confirm with your title, text, and button names (yesText and noText)
       
       PreAction.confirm(cf -> cf
        .title("Approve?") //or withoutTitle()
        .text("Changes will ba saved") //or withoutText()
        .yesText("Yes")
        .noText("Cancel"))
       
       
      Returns:
      preActio
    • confirmWithWidget

      public static PreAction confirmWithWidget(@NonNull @NonNull String widget, @NonNull @NonNull UnaryOperator<PreActionConfirmWithWidgetBuilder.Cfw> cf)
      confirm with your widget, title, and button names (yesText and noText)
      Parameters:
      widget - widget name of any *FormPopup.widget.json placed on same view and having same bc, as widget with button, that triggered confirmation
       
       PreAction.confirmWithWidget("myWidget", cf -> cf
        .title("Approve?") //or withoutTitle()
        .yesText("Yes")
        .noText("Cancel"))
       
       
      Returns:
      preAction
    • info

      public static PreAction info(String message)
    • info

      public static PreAction info()
    • error

      public static PreAction error(String message)
    • error

      public static PreAction error()
    • custom

      public static PreAction custom(String message, Map<String,String> customParameters)
    • builder

      public static PreAction.PreActionBuilder builder()
    • getType

      public String getType()
    • getMessage

      public String getMessage()
    • getCustomParameters

      public Map<String,String> getCustomParameters()
    • getMessage

      public String getMessage(String action)