Enables a user to add, remove, copy, or reorder the rows in a table by dragging the rows to perform the action.
If the Reorder attribute is set to true, the com.webmethods.caf.faces.data.IReorderableTableContentProvider
interface for the target table's content provider is used to persist the new row order. The new row ordering is not sent to the server until the table's enclosing form is posted to the server after passing validation.
If the Add or Remove attributes are set to true, the target table's interface content-provider com.webmethods.caf.faces.data.IUpdateableTableContentProvider
is used to persist the changes. The updated table information is not sent to the server until the table's enclosing form is posted to the server after passing validation.
If the Copy attribute is set to true and the Remove attribute is set to false, dragging a row from one table to a destination table adds a new row to the other table, without removing the original row from the first table. The destination table must have the Add attribute set to true. If the Remove attribute is set to true, the Copy attribute is ignored and dragging a row from one table to another removes the original row from the first table.
To populate the controls of a newly added row, the Drag to Move Rows behavior copies the value of controls with the same local ID from the dropped row into the new row.
For more information about adding, removing, and reordering rows, see "CAF.Table.Row.Model" in the CAF Development Help.
To customize Drag to Move Rows behavior, you can specify custom JavaScript code to execute when:
The allowDrag handler is invoked every time a user tries to drag a row in this behavior's target table. It is passed two arguments, draggable and event. The draggable argument is the dragged row's CAF.Draggable
object; the event argument is the browser mouse event that precipitates the drag. The handler should return true if the row if draggable is enabled, and false if dragging is not enabled.
The allowDrop handler is invoked every time a user tries to drag a row over the Drag to Move Rows target table's boundaries. allowDrop is passed two arguments, src and dst. The src argument is the dragged HTML element, which is a container for a temporary copy of the original row element in a temporary table. The dst argument is the HTML drop-target element, which is a container for the target table. The handler should return true if the row can be dropped and false if it cannot.
If the allowDrop handler returned true or was not specified, the handleDrop handler is invoked every time a user tries to drop a row on the Drag to Move Rows behavior's target table. It is passed two arguments: src and dst. The src argument is the dragged HTML element, which is a container for a temporary copy of the original row element, into a temporary table. The dst argument is the HTML drop-target element, which is a container for the target table.
The handler should return true if it fully handled the drop, and false to allow the default handleDrop processing to execute when the dropped row is from another table. If add
is allowed to create a new row and copy the values of controls with the same local ID from the original dropped row to the new row; and when the dropped row is from the same table and reorder
is allowed, to move the row to its new location.
For more information, see "CAF.Draggable Class" in the CAF Development Help.
Info | Value |
---|---|
Component Type | com.webmethods.caf.faces.behavior.DragToMoveRows |
Handler Class | None |
Renderer Type | com.webmethods.caf.faces.behavior.DragToMoveRows |
Description | Allows user to add, remove, copy, or reorder the rows in a table by dragging them |
Palette Location | CAF Html/Control/Behaviors/Drag To Move Rows |
Client-Side Model | CAF.DragToMoveRowsBehavior.Model |
Name | Required | Type | Description |
---|---|---|---|
add | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to allow rows from another table to be added to this table
If not specified, the default value is "false". |
allowDrag | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Custom JavaScript allowDrag event handler |
allowDrop | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Custom JavaScript allowDrop event handler |
copy | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to allow rows from this table to be copied to another table
If not specified, the default value is "false". |
for | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| ID of control to which to apply this behavior |
handleDrop | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Custom JavaScript handleDrop event handler |
hoverClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| CSS class to use when draggable control hovering over drop target |
id | false | java.lang.String | Control identifier |
propagateEvents | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to allow drag-start mouse click event to propagate
If not specified, the default value is "false". |
remove | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to allow rows to be removed from this table
If not specified, the default value is "false". |
rendered | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to render control; false to ignore it
If not specified, the default value is "true". |
reorder | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to allow rows in this table to be reordered
If not specified, the default value is "false". |
Output generated by Vdldoc View Declaration Language Documentation Generator.