Navigation Documents
Link navigation
This is an example of a simple link
from one wax:block to another wax:block
using the wax:a tag.
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:block id="first">
<wax:p>
First<wax:br/>
<wax:a href="#second">Second</wax:a>
</wax:p>
</wax:block>
<wax:block id="second">
<wax:p>Hello World</wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
Button navigation
In this example we again link two
wax:block s together using a wax:button .
wax:button s are mapped to physical buttons on
wireless phones; for other devices a regular link
is created.
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:block id="first">
<wax:button keytype="accept" type="go"
label="Second" href="#second"/>
<wax:p>First</wax:p>
</wax:block>
<wax:block id="second">
<wax:p>Hello World</wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
Template button navigation
To avoid repeating the same wax:button
code in every wax:block , there is a
wax:template . This template creates the same button
navigation in every block. wax:block s can override
this templating by defining their own wax:button
as in the example above.
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:template>
<wax:button keytype="accept" type="go"
label="Second" href="#second"/>
</wax:template>
<wax:block id="first">
<wax:p>First</wax:p>
</wax:block>
<wax:block id="second">
<wax:p>Hello World</wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
List navigation
Many times it is useful to define a list or menu of
links for navigation. This can be best defined like the example
below.
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:formblock>
<wax:choice type="single" style="linklist">
<wax:ci href="#first">First</wax:ci>
<wax:ci href="#second">Second</wax:ci>
</wax:choice>
</wax:formblock>
<wax:block id="first">
<wax:p>First</wax:p>
</wax:block>
<wax:block id="second">
<wax:p>Hello World</wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
Auto-magic navigation
This type of navigation is done on the user's behalf and can guide
them to particular wax:block s and at the same time do
some work for the application.
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:block id="first">
<wax:onenter>
<wax:forward type="go" href="#second"/>
</wax:onenter>
<wax:p>First</wax:p>
</wax:block>
<wax:block id="second">
<wax:onenter>
<wax:forward type="go" href="#last"/>
<wax:backward type="go" href="#first"/>
</wax:onenter>
<wax:p>Second</wax:p>
</wax:block>
<wax:block id="last">
<wax:onenter>
<wax:backward type="go" href="#second"/>
</wax:onenter>
<wax:p>Last</wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
Navigation and forms
Since each component is contained in it's own wax:formblock
there needs to be navigation among them. This navigation can be like
the types above or like the examples below. The following examples
use a short-hand for wax:button s.
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:formblock>
<wax:choice type="single" style="linklist"
href="#next">
<wax:ci>First</wax:ci>
<wax:ci>Second</wax:ci>
<wax:ci href="#last">Last</wax:ci>
</wax:choice>
</wax:formblock>
<wax:block id="next">
<wax:p> Hello </wax:p>
</wax:block>
<wax:block id="last">
<wax:p> Last </wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:formblock>
<wax:entry var="entered" href="#next"/>
</wax:formblock>
<wax:block id="next">
<wax:p> Hello </wax:p>
</wax:block>
<wax:block id="last">
<wax:p> Last </wax:p>
</wax:block>
</wax:doc>
</wax:wax>
|
Navigation items and types that don't work well together.
Most types of navigation can be mixed and matched to create complex
navigation, however some things don't mix.
wax:choice and wax:entry that have
href attributes don't like their parent
wax:formblock to have wax:button s with
a keytype attribute set to accept .
If this situation appears, there is ambiguity as to which
href will be used by the client in certain translations
(namely, WML and HDML).
wax:button s don't like other wax:button s
to have the same keytype as they do, within their local
group (a list of wax:button s right in a row), this
might be called overloading of the wax:button .
Not all translations can support this type of overloading and thus
should be avoided.
Standalone wax:backward tags do not translate well in all
situations and should be avoided.
Standalone wax:backward tags are wax:backward
tags in a wax:onenter that don't have a
wax:forward as a sibling.
Please note that all of the above examples use inter-document
href s ("#here" ). However
href s can be any nice URI.
|