Child pages
  • Client Design Mode

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The client design mode will not save the new positions/sizes of the elements this is someting that the developer has to take care of. By saving and restoring these elements for each user individualy you can give the user his personal layouts. To save and restore positions/sizes it is important to give all you elements names so you can reach them by code.

By entering the client design mode you can set the onDrag/onDragEnd/onDragOver/onDrop methods. If you don't set the methods by entering the client design mode it will use the method that are connected to the form properties.

...

Code Block
	controller.setDesignMode(true)

To exit client design mode you can use:

Code Block

	controller.setDesignMode(false)

By creating the onDrag/onDragEnd/onDragOver/onDrop from the form properties you get a sample method.

Code Block
/**
 * Handle a drag over. Determines of a drop is allowed in this location.
 *
 * Return true is drop is allowed, otherwise false.
 *
 * @param {JSDNDEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"A97879DD-6465-4A89-8210-122C94857626"}
 */
function onDragOver(event) {
	// TODO Auto-generated method stub
	if (event.getSource() && event.data) {
		return true;
	}
	return false;
}

...

onDrag

...

 * Handle start of a drag, it can set the data that should be transfered and should return a constant which dragndrop mode/modes is/are supported.
 *
 * Should return a DRAGNDROP constant or a combination of 2 constants:
 * DRAGNDROP.MOVE if only a move can happen,
 * DRAGNDROP.COPY if only a copy can happen,
 * DRAGNDROP.MOVE|DRAGNDROP.COPY if a move or copy can happen,
 * DRAGNDROP.NONE if nothing is supported (drag should not start).

...

onDragEnd

...

onDragOver

...

onDrop