Hi
In the shaleclay starter archetype [1] there is a menu structure that uses
the implicit tags, and works just fine:
<div id="menu">
<div id="button" class="button">
<span jsfid="form">
<p class="menu">
<span jsfid="outputText" value="#{messages['menu']}"
allowBody="false">Menu</span>
</p>
<ul>
<li>
<a jsfid="commandLink" action="home" allowBody="true"
immediate="true">
<span jsfid="outputText" value="#{messages['menu.item1']}"
allowBody="false">Home</span>
</a>
</li>
......
</ul>
</span>
</div>
</div>
So use an outcome defined in faces-config.xml as your action, not a direct
pointer to a view.
[1]
https://svn.apache.org/repos/asf/shale/maven/trunk/archetypes/shale-clay-sta
rter-archetype
Hermod
-----Opprinnelig melding-----
Fra: Richard Eggert [mailto:[EMAIL PROTECTED]
Sendt: 14. mars 2007 17:23
Til: [email protected]
Emne: Strange behavior from <a> tags when using Clay HTML templates
I'm having an issue using anchor (<a>) tags that are explicitly mapped to
h:commandLink (implicitly mapped tags don't work at all in this case).
Consider the following HTML template named bugTest.html loaded via an XML
view named "/bugTest.clay":
<html>
<body>
<form>
<a href="some-other-page.html" jsfid="h:commandLink"
action="/some-other-view.clay">
Go here
</a>
</form>
</body>
</html>
When viewed offline in a web browser, this page works fine.
However, when viewed online using Clay, the text within the link becomes
"some-other-page.html Go here" instead of just "Go here", and clicking on
the link just causes the page to reload.
Is this a bug, or am I doing something wrong? There doesn't seem to be any
valid reason why the contents of the "href" attribute should be moved to be
nested within the tag, or why the "action" attribute shouldn't propagate to
the commandLink component.
Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com