Child pages
  • Client Design Mode
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

The client design mode is made to make it possible for end users to edit the possitions and sizes of elements on a form. When the form enters client design mode the user can use drag & drop to replace elements or change elements in size.

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.

You can enter client design mode using:

	controller.setDesignMode(true)

To exit client design mode you can use:

	controller.setDesignMode(false)

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

/**
 * 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

Handle end of a drag. 

onDragOver

 Handle a drag over. Determines of a drop is allowed in this location.
 Return true is drop is allowed, otherwise false.

onDrop

 * Handle a drop.
 * Return true if drop has been performed successfully, otherwise false.

  • No labels