Lookup dialog

A lookup dialog is a HTML page dialog that can be configured to open for a simpleType in Xopus.

An example of how a lookup dialog can be used is for a required attribute on an element, which contains a reference to a value outside of the current document, and not available in the schema. Using the lookup configuration a uri can be provided pointing to the HTML page. The HTML page, or dynamic page, contains functionality to search the value.

Example

A link element in de XML has an attribute @href. This @href is configured as follows

<x:node match="link/@href">
   <x:lookup url="lookup-link-target.php" autoOpen="true"/>
</x:node>

When the link element is inserted, Xopus will validate the element and add the attribute. The lookup will then be opened. The lookup has access to Xopus through several means, and can return a value through the top.choose method.

top.dialogArguments

The dialogArgument object contains several properties

  • name (the name of the attribuut that is being looked up)

  • value (the current value)

  • node (the node that represents the attribute)

  • attributes

top.choose(obj)

Using this method a value, or multiple can be returned to Xopus.

top.choose({href:'http://xopus.com',target:'_blank'});
top.resizeTo(width,height)

This method can be used to resize the lookup dialog to a more appropriate size.

For more insight into how lookup page work, please take a look at the simple demo source, available in the Xopus download.


History

version event
Xopus 4 Change. The lookup editor is opened in an <iframe> instead of a popup window. Technically this brings one significant change: the lookup dialog is no longer synchronous.
Xopus 3 Introduction.