Class ActionResponse
Response
to be used with controllers.-
Field Summary
Fields inherited from class com.axelor.rpc.Response
STATUS_FAILURE, STATUS_LOGIN_INCORRECT, STATUS_LOGIN_REQUIRED, STATUS_LOGIN_SUCCESS, STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED, STATUS_SERVER_TIMEOUT, STATUS_SUCCESS, STATUS_TRANSPORT_ERROR, STATUS_VALIDATION_ERROR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Set an alert message.void
Set an alert message.void
setAlert
(String message, String title, String confirmBtnTitle, String cancelBtnTitle, String action) Set an alert message.void
Set an attribute of a field.void
Set field attributes.void
setCanClose
(boolean canClose) Set the canClose flag.void
Set thecolor
attribute for the given field.void
Set an error message.void
Set an error message.void
Set an error message.void
setExportFile
(InputStream stream, String fileName) Set the file stream to be exported.void
setExportFile
(String path) Set the file path to be exported.void
setExportFile
(String path, String fileName) Set the file path to be exported.void
setExportFile
(Path path) Set the file path to be exported.void
setExportFile
(Path path, String fileName) Set the file path to be exported.void
Set thehidden
attribute for the given field.void
Set an info message.void
Set an info message.void
Set an info message.void
Set a notification message.void
Set a notification message.void
setPending
(String actions) Set the comma separated list of pending actions.void
setReadonly
(String fieldName, boolean readonly) Set thereadonly
attribute for the given field.void
setReload
(boolean reload) Set the reload flag.void
setRequired
(String fieldName, boolean required) Set therequired
attribute for the given field.void
Send an arbitrary signal to the client view with the specified data.void
Set value for the given field.void
Set record values.void
Inform the client to open a view for the given model.void
Inform the client to open the given view.
-
Constructor Details
-
ActionResponse
public ActionResponse()
-
-
Method Details
-
setReload
public void setReload(boolean reload) Set the reload flag.The client user reload flag to refresh the view.
- Parameters:
reload
- whether to reload client view
-
setCanClose
public void setCanClose(boolean canClose) Set the canClose flag.The client uses the canClose flag to decide whether the view can be closed.
- Parameters:
canClose
- whether the view can be closed.
-
setInfo
Set an info message.This message will be shown on the client screen as a dialog.
- Parameters:
message
- the message to show on client
-
setInfo
Set an info message.This message will be shown on the client screen as a dialog.
- Parameters:
message
- the message to show on clienttitle
- the title of the modal
-
setInfo
Set an info message.This message will be shown on the client screen as a dialog.
- Parameters:
message
- the message to show on clienttitle
- the title of the modalconfirmBtnTitle
- the title of the confirm button
-
setNotify
Set a notification message.The message will be show on the client screen as a notification.
- Parameters:
message
- the message to show on client
-
setNotify
Set a notification message.The message will be show on the client screen as a notification.
- Parameters:
message
- the message to show on clienttitle
- the title of the notification box
-
setAlert
Set an alert message.The message will be shown on the client screen as an alert dialog.
- Parameters:
message
- the message to show as an alert
-
setAlert
Set an alert message.The message will be shown on the client screen as an alert dialog.
- Parameters:
message
- the message to show as an alerttitle
- the title of the modal
-
setAlert
public void setAlert(String message, String title, String confirmBtnTitle, String cancelBtnTitle, String action) Set an alert message.The message will be shown on the client screen as an alert dialog.
- Parameters:
message
- the message to show as an alerttitle
- the title of the modalconfirmBtnTitle
- the title of the confirm buttoncancelBtnTitle
- the title of the cancel buttonaction
- action to be executed on error or alert message to make corrective measures, when error dialog is closed or alert dialog is canceled.
-
setError
Set an error message.The message will be shown on the client screen as an error dialog.
- Parameters:
message
- the message to show as an error
-
setError
Set an error message.The message will be shown on the client screen as an error dialog.
- Parameters:
message
- the message to show as an errortitle
- the title of the modal
-
setError
Set an error message.The message will be shown on the client screen as an error dialog.
- Parameters:
message
- the message to show as an errortitle
- the title of the modalconfirmBtnTitle
- the title of the confirm buttonaction
- action to be executed on error or alert message to make corrective measures, when error dialog is closed or alert dialog is canceled.
-
setPending
Set the comma separated list of pending actions.This can be used along with
setAlert(String)
,setError(String)
methods.- Parameters:
actions
- the list of pending actions
-
setExportFile
Set the file path to be exported.The file path is copied to a dedicated temporary file for pending export.
The client will initiate downloading the export file.
- Parameters:
path
- the path to the export file
-
setExportFile
Set the file path to be exported.The file path is copied to a dedicated temporary file for pending export.
The client will initiate downloading the export file.
- Parameters:
path
- the path to the export filefileName
- the name of the downloaded export file
-
setExportFile
Set the file path to be exported.The file path is copied to a dedicated temporary file for pending export.
The client will initiate downloading the export file.
- Parameters:
path
- the path to the export file
-
setExportFile
Set the file path to be exported.The file path is copied to a dedicated temporary file for pending export.
The client will initiate downloading the export file.
- Parameters:
path
- the path to the export filefileName
- the name of the downloaded export file
-
setExportFile
Set the file stream to be exported.This creates a pending export file from the given stream.
The client will initiate downloading the export file.
- Parameters:
stream
- the stream to the export filefileName
- the name of the downloaded export file
-
setValues
Set record values.The client will update current view with these values.
The context can be a
Map
,Context
orModel
proxy obtained withContext.asType(Class)
. Managed instance ofModel
should be avoided.- Parameters:
context
- the context to set, a map or context proxy- Throws:
IllegalArgumentException
- if passed context is detached non-proxy entity.- See Also:
-
setValue
Set value for the given field.- Parameters:
fieldName
- name of the fieldvalue
- field name- See Also:
-
setView
Inform the client to open the given view.- Parameters:
view
- the view to show
-
setView
Inform the client to open a view for the given model.- Parameters:
title
- the view titlemodel
- the model namemode
- the view mode (e.g. form, grid etc)domain
- the filter
-
setSignal
Send an arbitrary signal to the client view with the specified data.- Parameters:
signal
- signal namedata
- signal data
-
setAttrs
Set field attributes.The client view may update the view fields with the given attributes.
- Parameters:
attrs
- attribute map for the fields
-
setAttr
Set an attribute of a field.- Parameters:
fieldName
- name of the fieldattr
- attribute namevalue
- attribute value
-
setRequired
Set therequired
attribute for the given field.- Parameters:
fieldName
- name of the fieldrequired
- true or false
-
setReadonly
Set thereadonly
attribute for the given field.- Parameters:
fieldName
- name of the fieldreadonly
- true or false
-
setHidden
Set thehidden
attribute for the given field.- Parameters:
fieldName
- name of the fieldhidden
- true or false
-
setColor
Set thecolor
attribute for the given field.- Parameters:
fieldName
- name of the fieldcolor
- CSS compatible color value
-