Skip to content
architolk edited this page Dec 29, 2016 · 1 revision

You use a FrameAppearance to create a left frame and a right frame. Both frames can contain representations from different sources. Using the FrameAppearance you could create a screen containing a parent/child view. For example: a left frame containing a parent resource, and a right frame containing some child of the master resource. The child frame is refreshed any time the user selects a link on the master frame.

The FrameAppearance is experimental: it might not work as expected with some appearances.

Frame appearance

Example

This example shows a master and a child frame. When the user clicks on the "Refresh right frame" link, the right frame will be refreshed.

@prefix elmo: <http://bp4mc2.org/elmo/def#>.
@prefix xhtml: <http://www.w3.org/1999/xhtml/vocab#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix stage: <http://localhost:8080/stage#>. 
stage:FrameAppearance_Frame a elmo:Part;
	elmo:appearance elmo:FrameAppearance;
	elmo:data [
		elmo:data [
			html:link "/query/FrameLeft";
			elmo:index "1";
		];
		elmo:data [
			html:link "/query/FrameRight";
			elmo:index "2";
		]
	]
.
stage:FrameAppearance_Left a elmo:Representation;
	elmo:url-pattern "/query/FrameLeft$";
	elmo:appearance elmo:HtmlAppearance;
	elmo:data [
		rdfs:label "Left";
		elmo:html '''
			<p>Frame left</p>
			<a href="#" onclick="parent.document.getElementsByName('frame2')[0].src='/query/FrameRight2'; return false;">Refresh right frame</a>
		''';
	]
.
stage:FrameAppearance_Right a elmo:Representation;
	elmo:url-pattern "/query/FrameRight$";
	elmo:appearance elmo:HtmlAppearance;
	elmo:data [
		rdfs:label "Right";
		elmo:html '''
			<p>Frame right</p>
		''';
	]
.
stage:FrameAppearance_Right2 a elmo:Representation;
	elmo:url-pattern "/query/FrameRight2$";
	elmo:appearance elmo:HtmlAppearance;
	elmo:data [
		rdfs:label "Right (new content)";
		elmo:html '''
			<p>Frame right (new content)</p>
		''';
	]
.

Clone this wiki locally