Class ActionResponse
- java.lang.Object
-
- com.axelor.rpc.Response
-
- com.axelor.rpc.ActionResponse
-
-
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 Constructor Description ActionResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setAlert(String message)
Set an alert message.void
setAlert(String message, String title)
Set an alert message.void
setAlert(String message, String title, String confirmBtnTitle, String cancelBtnTitle, String action)
Set an alert message.void
setAttr(String fieldName, String attr, Object value)
Set an attribute of a field.void
setAttrs(Map<String,Map<String,Object>> attrs)
Set field attributes.void
setCanClose(boolean canClose)
Set the canClose flag.void
setColor(String fieldName, String color)
Set thecolor
attribute for the given field.void
setError(String message)
Set an error message.void
setError(String message, String title)
Set an error message.void
setError(String message, String title, String confirmBtnTitle, String action)
Set an error message.void
setExportFile(String path)
Set the file path relative to the data export directory.void
setHidden(String fieldName, boolean hidden)
Set thehidden
attribute for the given field.void
setInfo(String message)
Set an info message.void
setInfo(String message, String title)
Set an info message.void
setInfo(String message, String title, String confirmBtnTitle)
Set an info message.void
setNotify(String message)
Set a notification message.void
setNotify(String message, String title)
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
setSignal(String signal, Object data)
Send an arbitrary signal to the client view with the specified data.void
setValue(String fieldName, Object value)
Set value for the given field.void
setValues(Object context)
Set record values.void
setView(String title, String model, String mode, String domain)
Inform the client to open a view for the given model.void
setView(Map<String,Object> view)
Inform the client to open the given view.
-
-
-
Method Detail
-
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
public void setInfo(String message)
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
public void setInfo(String message, String title)
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
public void setInfo(String message, String title, String confirmBtnTitle)
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
public void setNotify(String message)
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
public void setNotify(String message, String title)
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
public void setAlert(String message)
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
public void setAlert(String message, String title)
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
public void setError(String message)
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
public void setError(String message, String title)
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
public void setError(String message, String title, String confirmBtnTitle, String action)
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
public void setPending(String actions)
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
public void setExportFile(String path)
Set the file path relative to the data export directory.The client will initiate downloading the exported file.
- Parameters:
path
- the relative path to the exported file
-
setValues
public void setValues(Object context)
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(String, Object)
,Context.asType(Class)
-
setValue
public void setValue(String fieldName, Object value)
Set value for the given field.- Parameters:
fieldName
- name of the fieldvalue
- field name- See Also:
setValues(Object)
-
setView
public void setView(Map<String,Object> view)
Inform the client to open the given view.- Parameters:
view
- the view to show
-
setView
public void setView(String title, String model, String mode, String domain)
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
public void setSignal(String signal, Object data)
Send an arbitrary signal to the client view with the specified data.- Parameters:
signal
- signal namedata
- signal data
-
setAttrs
public void setAttrs(Map<String,Map<String,Object>> attrs)
Set field attributes.The client view may update the view fields with the given attributes.
- Parameters:
attrs
- attribute map for the fields
-
setAttr
public void setAttr(String fieldName, String attr, Object value)
Set an attribute of a field.- Parameters:
fieldName
- name of the fieldattr
- attribute namevalue
- attribute value
-
setRequired
public void setRequired(String fieldName, boolean required)
Set therequired
attribute for the given field.- Parameters:
fieldName
- name of the fieldrequired
- true or false
-
setReadonly
public void setReadonly(String fieldName, boolean readonly)
Set thereadonly
attribute for the given field.- Parameters:
fieldName
- name of the fieldreadonly
- true or false
-
setHidden
public void setHidden(String fieldName, boolean hidden)
Set thehidden
attribute for the given field.- Parameters:
fieldName
- name of the fieldhidden
- true or false
-
-