Flash Drawing Control

Implement multiple room selection mode in Flash Drawings

Technologies / User Interface add-Ins / Flash Drawing Views / Select Multiple Rooms Using Multi-Select Control
Technologies / User Interface add-Ins / Flash Drawing Views / Assign/Unassign Multiple Rooms Using Multi-Select Control

Note: With the release of ARCHIBUS V.23.2, all ARCHIBUS views were converted to use the HTML drawing control instead of the Flash drawing control. If you have previously created views that use the Flash drawing control, the view's drawings will still work.

For new views that you create, ARCHIBUS, Inc. recommends using the HTML control, as the Flash control is slated for desupport in future versions of ARCHIBUS. For information on converting existing views with Flash drawings to HTML format, see Convert views with the Flash drawing control to the HTML drawing control.

When multiple selection is enabled, the drawing toolbar displays the Multiple Room Selection icon. To enable multiple room selection mode, you must:

  1. Set the assignMode property of the drawing control (typical value is 2, e.g. One to Many).
  2. Attach the onMultipleSelectionChange JS event listener to the drawing panel.

onMultipleSelectionChange

To define the onMultipleSelectionChange event listener, define the JS controller method (or a function):

onMultipleSelectionChange: function() {
// get the array of selected room primary keys
var selectedRooms = this.drawingPanel.getMultipleSelectedAssets();
for (var i = 0; i < selectedRooms.length; i++) {
// do something with each selected room
// pks is an array containing building, floor, and room IDs
var pks = selectedRooms[i].pks;
}
}

Then attach this method as an event listener to the drawing panel:

this.drawingPanel.addEventListener(
'onMultipleSelectionChange',
this.onMultipleSelectionChange.createDelegate(this));

getMultipleSelectedAssets ()

Retrieves an array of the selected assets. Each element of the selected assets array contains has this data structure:

.pks: an array of primary keys of the select asset
.selected: Boolean. True of the asset is selected, false if unselected.
.color: hex color code of the asset.

Example:

var selectedRooms = this.dwgPanel.getMultipleSelectedAssets();
for (var i = 0; i < selectedRooms.length; i++) {
var id = selectedRooms[i].pks[0] + '-' + selectedRooms[i].pks[1] + '-' +
selectedRooms[i].pks[2];
}

getAssignedValue ()

Retrieves the value of the assigned object.

Example:

var assignedValue = this.dwgPanel.getAssignedValue();

getAssignOneToManyAssets ()

Retrieves an array of the assigned one-to-many assets. Each element of the selected assets array contains has this data structure:

.pks: an array of primary keys of the select asset.

.selected: boolean. true of the asset is selected, false if unselected.

.color: hex color.

Examples

http://localhost:8080/archibus/schema/ab-products/solutions/drawing/multiselect/ab-ex-selectonly-multiplerooms-drawing.axvw -- Shows multiple-selecting the assets without any assignment.

http://localhost:8080/archibus/schema/ab-products/solutions/drawing/multiselect/ab-ex-assignandselect-multiplerooms-drawing.axvw-- Shows multiple-selecting the assets and assigning them.

 

See also: Use multiple-room selections

Copyright © 1984-2018, ARCHIBUS, Inc. All rights reserved.