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 voidsetAlert(String message)Set an alert message.voidsetAlert(String message, String title)Set an alert message.voidsetAlert(String message, String title, String confirmBtnTitle, String cancelBtnTitle, String action)Set an alert message.voidsetAttr(String fieldName, String attr, Object value)Set an attribute of a field.voidsetAttrs(Map<String,Map<String,Object>> attrs)Set field attributes.voidsetCanClose(boolean canClose)Set the canClose flag.voidsetColor(String fieldName, String color)Set thecolorattribute for the given field.voidsetError(String message)Set an error message.voidsetError(String message, String title)Set an error message.voidsetError(String message, String title, String confirmBtnTitle, String action)Set an error message.voidsetExportFile(String path)Set the file path relative to the data export directory.voidsetHidden(String fieldName, boolean hidden)Set thehiddenattribute for the given field.voidsetInfo(String message)Set an info message.voidsetInfo(String message, String title)Set an info message.voidsetInfo(String message, String title, String confirmBtnTitle)Set an info message.voidsetNotify(String message)Set a notification message.voidsetNotify(String message, String title)Set a notification message.voidsetPending(String actions)Set the comma separated list of pending actions.voidsetReadonly(String fieldName, boolean readonly)Set thereadonlyattribute for the given field.voidsetReload(boolean reload)Set the reload flag.voidsetRequired(String fieldName, boolean required)Set therequiredattribute for the given field.voidsetSignal(String signal, Object data)Send an arbitrary signal to the client view with the specified data.voidsetValue(String fieldName, Object value)Set value for the given field.voidsetValues(Object context)Set record values.voidsetView(String title, String model, String mode, String domain)Inform the client to open a view for the given model.voidsetView(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,ContextorModelproxy obtained withContext.asType(Class). Managed instance ofModelshould 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 therequiredattribute for the given field.- Parameters:
fieldName- name of the fieldrequired- true or false
-
setReadonly
public void setReadonly(String fieldName, boolean readonly)
Set thereadonlyattribute for the given field.- Parameters:
fieldName- name of the fieldreadonly- true or false
-
setHidden
public void setHidden(String fieldName, boolean hidden)
Set thehiddenattribute for the given field.- Parameters:
fieldName- name of the fieldhidden- true or false
-
-