You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by membersound <me...@web.de> on 2012/11/23 18:52:11 UTC

How to pass the object itself by eventlink?

How can I just pass the object of an eventlink within a table row?

The following does not work, I don't understand why:

<t:grid source="objects" row="object" add="action">
 <p:actionCell>
  <t:eventLink event="createObject" context="object">Create
Object</t:eventLink>
 </p:actionCell>
</t:grid>


class MyPage {
   @Property
   Object object;

   @Property
   List objects;

   public void onCreateObject(Object object) {
       object.getXX();
   }
}

[ERROR] TapestryModule.RequestExceptionHandler Processing of request failed
with uncaught exception: Exception in method My.onCreateObject($Song),
parameter #1: Could not find a coercion from type java.lang.String to type
$Object.
org.apache.tapestry5.runtime.ComponentEventException: Exception in method
MyPage.onCreateObject($Song), parameter #1: Could not find a coercion from
type java.lang.String to type $Object.




--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-pass-the-object-itself-by-eventlink-tp5718208.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to pass the object itself by eventlink?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Answering the question in the subject: just pass it.

On Fri, 23 Nov 2012 15:52:11 -0200, membersound <me...@web.de> wrote:

> How can I just pass the object of an eventlink within a table row?

The same way you'd do it if it wasn't inside a table row.

> The following does not work, I don't understand why:

Implement a ValueEncoder for it and contribute it to the  
ValueEncoderSource service.

The 'why' is that Tapestry doesn't know how to map your object to a String  
and vice-versa.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org