Buttons

Smartsite 7.7 - ...

The buttons element gives the opportunity to remove and/or add buttons to the button-bar of the library.

XML CopyCode image Copy Code
<buttons>
  <remove name="add" />
  <remove name="edit" />
  <remove name="delete" />
  <remove name="duplicate" />
  <add name="disable" label="AIM_DISABLE" cssclass="icon_sys22 icon-sys22-aimdisable" buttonenabled="callback" title="AIM_DISABLE_SELECTION_TITLE" />
  <add name="enable" label="AIM_ENABLE" cssclass="icon_sys22 icon-sys22-aimenable" buttonenabled="callback" title="AIM_ENABLE_SELECTION_TITLE" />
  <add name="rescan" label="AIM_RESCAN" cssclass="icon_sys22 icon-sys22-aimrescan" buttonenabled="callback" title="AIM_RESCAN_SELECTION_TITLE" />
  <add name="itemdetails" label="DETAILS" cssclass="icon_sys22 icon-sys22-details" buttonenabled="singleselect" actioncode="mgr-ITEMDETAILS"/>
</buttons>

Remove

To remove one or more default buttons, just add a remove element for each button and specify the name of the button which should be removed.

The default buttons for a (custom) dataeditor library are:

  • add
  • edit
  • delete
  • duplicate

Add

You can also add buttons (see the example above), which will e.g. start the action as specified by the actioncode, or execute the logic implemented by the Implementation.

The table below lists the configuration parameters (attributes):

Parameter Description
name (required) The name (action) of the button.
label The label of the button (usually a localization string).
cssclass Css class (usually an icon reference).
title (optional) The title/tooltip (usually a localization string).
position (optional) The position at which the button should be inserted.
When no position have been specified, the button will be added at the end, just before the close button. 
buttonenabled (optional)

A string indicating under what circumstances the button should be enabled:

  • true : the button should always be enabled.
  • onselection : the button should be enabled when one or more results have been selected.
  • singleselect : the button should be enabled only when there is just one result selected.
  • callback : the custom Implementation object (if any) will be invoked (the onUpdateButtonState method) and the object should determine whether or not the button must be enabled.
actioncode (optional)

The action-code of the action that should be invoked when the button is clicked (which will open a new tab). The action will only be invoked if the current user has access to it.

The primary key(s) of the selected row(s) will be included within the action parameters (entry with the name Nr) when executing the action.
By default, only the first primary key will be included. To include all the selected primary keys, add the attribute multiselect and set it's value to true.

When no actioncode has been specified, the custom Implementation object (if any) will be invoked (the OnCustomButtonClicked method) and the object should handle the requested action.

Notice that the action(code) corresponds with the name of the button.

startassubaction (optional)

Boolean, indicating whether or not the specified action should be started as subaction or within a new tab (which is the default).

This option is new within Smartsite 8.0.