In your second example, "5" is interpreted as String.

In your first example, I am not sure. What type is listItem.metadata.metadataId? Maybe it is not long?

Andy



tapestryphoto schrieb:

I have a PageLink thus:

<t:PageLink t:page="viewMetadata" t:context="listItem.metadata.metadataId">
  &gt;
</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">
  &gt;
</t:PageLink>


So, what have I done wrong?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to