Hi,
the problem is not your pagelink, the problem is your stylesheet link.
When it trys to load, it seems to search in "viewMetadata/style.css",
thus being passed as an activation context which of course cannot be
coerced to long.
Anyway, in my opinion the best way to pass the stylesheet is the
@IncludeStylesheet-Annotation.
@IncludeStylesheet("context:/style.css")
class ViewMetadata {
[...]
}
An alternative and something you might need when including images, for
example, is by using Assets:
viewMetadata.java:
----------------------------------------------------------------------------
@Inject
@Path("context:/style.css")
@Property
Asset cssFile;
----------------------------------------------------------------------------
viewMetadata.tml
----------------------------------------------------------------------------
<link href="${cssFile}" rel="stylesheet" type="text/css">
----------------------------------------------------------------------------
More on Assets: http://tapestry.apache.org/tapestry5/guide/assets.html
- Tobias
tapestryphoto schrieb:
I have a PageLink thus:
<t:PageLink t:page="viewMetadata"
t:context="listItem.metadata.metadataId">
>
</t:PageLink>
and code thus:
public void onActivate(long metadataId)
{
System.out.println("METADATA ID = "+metadataId);
this.metadata = repository.getMetaDataById(metadataId);
}
Although every time I click on the link I get taken to the correct
page and the passed value is printed out correctly, I also get the
following exception:
[ERROR] TapestryModule.RequestExceptionHandler Processing of request
failed with uncaught exception: Exception in method
dportal.pages.ViewMetadata.onActivate(long) (at ViewMetadata.java:20),
parameter #1: Coercion of style.css to type java.lang.Long (via String
--> Long) failed: For input string: "style.css"
org.apache.tapestry5.runtime.ComponentEventException: Exception in
method dportal.pages.ViewMetadata.onActivate(long) (at
ViewMetadata.java:20), parameter #1: Coercion of style.css to type
java.lang.Long (via String --> Long) failed: For input string:
"style.css"
This occurs even when hard-coding the value thus:
<t:PageLink t:page="viewMetadata" t:context="5">
>
</t:PageLink>
So, what have I done wrong?
p.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]