You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Warner Onstine <sw...@warneronstine.com> on 2004/02/17 20:18:44 UTC

DirectLink question

Ok, So after reviewing the code that everyone sent on the CRUD stuff 
earlier I embarked on implementing said functionality. Looking at 
ExternalLink (this was used in one of the examples) and DirectLink, I 
decided to go with DirectLink.

I use a ForEach on the rows to loop through my Events. That value is 
stored in setEvent(). I successfully have each event name and date 
showing up in my listing and I have a DirectLink setup for editing. The 
DirectLink looks like this:
<a jwcid="@DirectLink" listener="ognl:listeners.editEventAction" 
parameters="ognl:event">Edit Event</a>

This resides in a foreach that has a value="ognl:event". The error that 
I am getting when I try to load this page now (it was working before I 
added the DirectLink code) is -
Could not find an adaptor for class com.sandcast.Event.

Any help is greatly appreciated.

-warner



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


Re: DirectLink question

Posted by "Kevin C. Dorff" <kd...@kcp.com>.
If you are using Hibernate to handle your data storage, send the key as 
the param to the direct even and it is EASY to get the object back using 
hibernate and the key.

Kevin

Warner Onstine wrote:

> Thanks all! That makes sense. I'm going to go with Erik's suggestion 
> as I understand the solution (and the problem now with what I was 
> trying to do). I was hoping that it would be simple to just drop in 
> Event and send it on to the next form that way, but I'll just grab the 
> id, populate it and then send it on.
>
> Thanks again! Getting the hang of this, slowly but surely.
>
> -warner
>
> On Feb 17, 2004, at 12:37 PM, Erik Hatcher wrote:
>
>> My guess is Event is not Serializable.
>>
>> If Event is a large object, it is best not to use it as a DirectLink 
>> parameter (even though that seems mighty convenient).  Use the 
>> primary key or something like that instead.
>>
>>     Erik
>>
>> On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
>>
>>> Ok, So after reviewing the code that everyone sent on the CRUD stuff 
>>> earlier I embarked on implementing said functionality. Looking at 
>>> ExternalLink (this was used in one of the examples) and DirectLink, 
>>> I decided to go with DirectLink.
>>>
>>> I use a ForEach on the rows to loop through my Events. That value is 
>>> stored in setEvent(). I successfully have each event name and date 
>>> showing up in my listing and I have a DirectLink setup for editing. 
>>> The DirectLink looks like this:
>>> <a jwcid="@DirectLink" listener="ognl:listeners.editEventAction" 
>>> parameters="ognl:event">Edit Event</a>
>>>
>>> This resides in a foreach that has a value="ognl:event". The error 
>>> that I am getting when I try to load this page now (it was working 
>>> before I added the DirectLink code) is -
>>> Could not find an adaptor for class com.sandcast.Event.
>>>
>>> Any help is greatly appreciated.
>>>
>>> -warner
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>



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


directory structure for HTML templates?

Posted by Ezra Epstein <ee...@prajnait.com>.
We're wondering if there is an easy way to structure our HTML in the context
root?  In other words, to separate designers from developers we plan to keep
the .page (and .jwc) with the .java files in the package structure.  But we
want the .html elsewhere: nearer to the context root.

So, is there an easy way to structure the location of html?  Must we resort
with to Libraries?

As an example,  we would like:
	/context
		/browse
			page1.html
			page2.html
		/check-out
			page1.html
			page2.html

etc.

Thanks,

Ezra E.


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


Re: DirectLink question

Posted by Warner Onstine <wa...@warneronstine.com>.
Thanks all! That makes sense. I'm going to go with Erik's suggestion as 
I understand the solution (and the problem now with what I was trying 
to do). I was hoping that it would be simple to just drop in Event and 
send it on to the next form that way, but I'll just grab the id, 
populate it and then send it on.

Thanks again! Getting the hang of this, slowly but surely.

-warner

On Feb 17, 2004, at 12:37 PM, Erik Hatcher wrote:

> My guess is Event is not Serializable.
>
> If Event is a large object, it is best not to use it as a DirectLink 
> parameter (even though that seems mighty convenient).  Use the primary 
> key or something like that instead.
>
> 	Erik
>
> On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
>
>> Ok, So after reviewing the code that everyone sent on the CRUD stuff 
>> earlier I embarked on implementing said functionality. Looking at 
>> ExternalLink (this was used in one of the examples) and DirectLink, I 
>> decided to go with DirectLink.
>>
>> I use a ForEach on the rows to loop through my Events. That value is 
>> stored in setEvent(). I successfully have each event name and date 
>> showing up in my listing and I have a DirectLink setup for editing. 
>> The DirectLink looks like this:
>> <a jwcid="@DirectLink" listener="ognl:listeners.editEventAction" 
>> parameters="ognl:event">Edit Event</a>
>>
>> This resides in a foreach that has a value="ognl:event". The error 
>> that I am getting when I try to load this page now (it was working 
>> before I added the DirectLink code) is -
>> Could not find an adaptor for class com.sandcast.Event.
>>
>> Any help is greatly appreciated.
>>
>> -warner
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>



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


Re: DirectLink question

Posted by Paul Ferraro <pm...@columbia.edu>.
To use a date as a direct link parameter, you can create a custom 
ISqueezeAdaptor that looks something like this:

public class DateAdaptor implements 
org.apache.tapestry.util.io.ISqueezeAdaptor
{
    public void register(org.apache.tapestry.util.io.DataSqueezer squeezer)
    {
       // I think "d" is already reserved for java.lang.Double
       squeezer.register("D", java.util.Date.class, this);
    }

    public String squeeze(org.apache.tapestry.util.io.DataSqueezer 
squeezer, Object data)
    {
        return Long.toString(((java.util.Date) data).getTime());
    }

    public Object unsqueeze(org.apache.tapestry.util.io.DataSqueezer 
squeezer, String string)
    {
        return new Date(Long.parseLong(string));
    }
}

I've never actually tried this, so I'd have to look into how this 
adaptor gets registered with the DataSqueezer.

Paul Ferraro

Eric Schneider wrote:

>Erik,
>
>  
>
>>If Event is a large object, it is best not to use it as a DirectLink
>>parameter (even though that seems mighty convenient).
>>    
>>
>
>Excellent point.  Big objects don't "squeeze" well.  I don't believe this
>jumps out at you in the docs.  I've seen people attempt bind a
>java.util.Date to a DirectLink parameter on a high volume app.....the
>results were bad.  :-)
>
>Things like Strings, Integers, Maps, or other light-weight objects are good
>candidates.
>
>Cheers,
>e.
>
>
>----- Original Message ----- 
>From: "Erik Hatcher" <er...@ehatchersolutions.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Tuesday, February 17, 2004 2:37 PM
>Subject: Re: DirectLink question
>
>
>  
>
>>My guess is Event is not Serializable.
>>
>>If Event is a large object, it is best not to use it as a DirectLink
>>parameter (even though that seems mighty convenient).  Use the primary
>>key or something like that instead.
>>
>>Erik
>>
>>On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
>>
>>    
>>
>>>Ok, So after reviewing the code that everyone sent on the CRUD stuff
>>>earlier I embarked on implementing said functionality. Looking at
>>>ExternalLink (this was used in one of the examples) and DirectLink, I
>>>decided to go with DirectLink.
>>>
>>>I use a ForEach on the rows to loop through my Events. That value is
>>>stored in setEvent(). I successfully have each event name and date
>>>showing up in my listing and I have a DirectLink setup for editing.
>>>The DirectLink looks like this:
>>><a jwcid="@DirectLink" listener="ognl:listeners.editEventAction"
>>>parameters="ognl:event">Edit Event</a>
>>>
>>>This resides in a foreach that has a value="ognl:event". The error
>>>that I am getting when I try to load this page now (it was working
>>>before I added the DirectLink code) is -
>>>Could not find an adaptor for class com.sandcast.Event.
>>>
>>>Any help is greatly appreciated.
>>>
>>>-warner
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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


Re: DirectLink question

Posted by Programozás <pr...@hotmail.com>.
In case of Date it is simple to use getTime().

I had problems when I encoded Calendar parameters. In IE5 the link was not
triggered sometimes (IE did not send anything to the server!).
So I recommend everyone not to use huge encoded links...

Norbi

----- Original Message ----- 
From: "Eric Schneider" <er...@centralparksoftware.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, February 17, 2004 9:10 PM
Subject: Re: DirectLink question


> > How big is a java.util.Date?  That suprises me!
>
> You'd think it's just a month, day, and year in there.  ;-)
>
> I'm sure there's all types of heinous baggage that comes along with java
> Dates/Calendars in general.  Best way to find out about all the private
> class goop that hides behind the public api is get a decompiler and have a
> look at the source.
>
> It may be fine in smaller applications.  But, for us the application would
> start chucking mad exceptions before long.  Removing the date made these
> symptoms go away.
>
> e.
>
> ----- Original Message ----- 
> From: "Kevin C. Dorff" <kd...@kcp.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Tuesday, February 17, 2004 2:59 PM
> Subject: Re: DirectLink question
>
>
> > How big is a java.util.Date?  That suprises me!
> >
> > Eric Schneider wrote:
> >
> > >Erik,
> > >
> > >
> > >
> > >>If Event is a large object, it is best not to use it as a DirectLink
> > >>parameter (even though that seems mighty convenient).
> > >>
> > >>
> > >
> > >Excellent point.  Big objects don't "squeeze" well.  I don't believe
this
> > >jumps out at you in the docs.  I've seen people attempt bind a
> > >java.util.Date to a DirectLink parameter on a high volume app.....the
> > >results were bad.  :-)
> > >
> > >Things like Strings, Integers, Maps, or other light-weight objects are
> good
> > >candidates.
> > >
> > >Cheers,
> > >e.
> > >
> > >
> > >----- Original Message ----- 
> > >From: "Erik Hatcher" <er...@ehatchersolutions.com>
> > >To: "Tapestry users" <ta...@jakarta.apache.org>
> > >Sent: Tuesday, February 17, 2004 2:37 PM
> > >Subject: Re: DirectLink question
> > >
> > >
> > >
> > >
> > >>My guess is Event is not Serializable.
> > >>
> > >>If Event is a large object, it is best not to use it as a DirectLink
> > >>parameter (even though that seems mighty convenient).  Use the primary
> > >>key or something like that instead.
> > >>
> > >>Erik
> > >>
> > >>On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
> > >>
> > >>
> > >>
> > >>>Ok, So after reviewing the code that everyone sent on the CRUD stuff
> > >>>earlier I embarked on implementing said functionality. Looking at
> > >>>ExternalLink (this was used in one of the examples) and DirectLink, I
> > >>>decided to go with DirectLink.
> > >>>
> > >>>I use a ForEach on the rows to loop through my Events. That value is
> > >>>stored in setEvent(). I successfully have each event name and date
> > >>>showing up in my listing and I have a DirectLink setup for editing.
> > >>>The DirectLink looks like this:
> > >>><a jwcid="@DirectLink" listener="ognl:listeners.editEventAction"
> > >>>parameters="ognl:event">Edit Event</a>
> > >>>
> > >>>This resides in a foreach that has a value="ognl:event". The error
> > >>>that I am getting when I try to load this page now (it was working
> > >>>before I added the DirectLink code) is -
> > >>>Could not find an adaptor for class com.sandcast.Event.
> > >>>
> > >>>Any help is greatly appreciated.
> > >>>
> > >>>-warner
> > >>>
> > >>>
> > >>>
> > >>>---------------------------------------------------------------------
> > >>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > >>>For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
> > >>>
> > >>>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >>
> > >>
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

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


Re: DirectLink question

Posted by Eric Schneider <er...@centralparksoftware.com>.
> How big is a java.util.Date?  That suprises me!

You'd think it's just a month, day, and year in there.  ;-)

I'm sure there's all types of heinous baggage that comes along with java
Dates/Calendars in general.  Best way to find out about all the private
class goop that hides behind the public api is get a decompiler and have a
look at the source.

It may be fine in smaller applications.  But, for us the application would
start chucking mad exceptions before long.  Removing the date made these
symptoms go away.

e.

----- Original Message ----- 
From: "Kevin C. Dorff" <kd...@kcp.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, February 17, 2004 2:59 PM
Subject: Re: DirectLink question


> How big is a java.util.Date?  That suprises me!
>
> Eric Schneider wrote:
>
> >Erik,
> >
> >
> >
> >>If Event is a large object, it is best not to use it as a DirectLink
> >>parameter (even though that seems mighty convenient).
> >>
> >>
> >
> >Excellent point.  Big objects don't "squeeze" well.  I don't believe this
> >jumps out at you in the docs.  I've seen people attempt bind a
> >java.util.Date to a DirectLink parameter on a high volume app.....the
> >results were bad.  :-)
> >
> >Things like Strings, Integers, Maps, or other light-weight objects are
good
> >candidates.
> >
> >Cheers,
> >e.
> >
> >
> >----- Original Message ----- 
> >From: "Erik Hatcher" <er...@ehatchersolutions.com>
> >To: "Tapestry users" <ta...@jakarta.apache.org>
> >Sent: Tuesday, February 17, 2004 2:37 PM
> >Subject: Re: DirectLink question
> >
> >
> >
> >
> >>My guess is Event is not Serializable.
> >>
> >>If Event is a large object, it is best not to use it as a DirectLink
> >>parameter (even though that seems mighty convenient).  Use the primary
> >>key or something like that instead.
> >>
> >>Erik
> >>
> >>On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
> >>
> >>
> >>
> >>>Ok, So after reviewing the code that everyone sent on the CRUD stuff
> >>>earlier I embarked on implementing said functionality. Looking at
> >>>ExternalLink (this was used in one of the examples) and DirectLink, I
> >>>decided to go with DirectLink.
> >>>
> >>>I use a ForEach on the rows to loop through my Events. That value is
> >>>stored in setEvent(). I successfully have each event name and date
> >>>showing up in my listing and I have a DirectLink setup for editing.
> >>>The DirectLink looks like this:
> >>><a jwcid="@DirectLink" listener="ognl:listeners.editEventAction"
> >>>parameters="ognl:event">Edit Event</a>
> >>>
> >>>This resides in a foreach that has a value="ognl:event". The error
> >>>that I am getting when I try to load this page now (it was working
> >>>before I added the DirectLink code) is -
> >>>Could not find an adaptor for class com.sandcast.Event.
> >>>
> >>>Any help is greatly appreciated.
> >>>
> >>>-warner
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: DirectLink question

Posted by "Kevin C. Dorff" <kd...@kcp.com>.
How big is a java.util.Date?  That suprises me!

Eric Schneider wrote:

>Erik,
>
>  
>
>>If Event is a large object, it is best not to use it as a DirectLink
>>parameter (even though that seems mighty convenient).
>>    
>>
>
>Excellent point.  Big objects don't "squeeze" well.  I don't believe this
>jumps out at you in the docs.  I've seen people attempt bind a
>java.util.Date to a DirectLink parameter on a high volume app.....the
>results were bad.  :-)
>
>Things like Strings, Integers, Maps, or other light-weight objects are good
>candidates.
>
>Cheers,
>e.
>
>
>----- Original Message ----- 
>From: "Erik Hatcher" <er...@ehatchersolutions.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Tuesday, February 17, 2004 2:37 PM
>Subject: Re: DirectLink question
>
>
>  
>
>>My guess is Event is not Serializable.
>>
>>If Event is a large object, it is best not to use it as a DirectLink
>>parameter (even though that seems mighty convenient).  Use the primary
>>key or something like that instead.
>>
>>Erik
>>
>>On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
>>
>>    
>>
>>>Ok, So after reviewing the code that everyone sent on the CRUD stuff
>>>earlier I embarked on implementing said functionality. Looking at
>>>ExternalLink (this was used in one of the examples) and DirectLink, I
>>>decided to go with DirectLink.
>>>
>>>I use a ForEach on the rows to loop through my Events. That value is
>>>stored in setEvent(). I successfully have each event name and date
>>>showing up in my listing and I have a DirectLink setup for editing.
>>>The DirectLink looks like this:
>>><a jwcid="@DirectLink" listener="ognl:listeners.editEventAction"
>>>parameters="ognl:event">Edit Event</a>
>>>
>>>This resides in a foreach that has a value="ognl:event". The error
>>>that I am getting when I try to load this page now (it was working
>>>before I added the DirectLink code) is -
>>>Could not find an adaptor for class com.sandcast.Event.
>>>
>>>Any help is greatly appreciated.
>>>
>>>-warner
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>



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


Re: DirectLink question

Posted by Eric Schneider <er...@centralparksoftware.com>.
Erik,

> If Event is a large object, it is best not to use it as a DirectLink
> parameter (even though that seems mighty convenient).

Excellent point.  Big objects don't "squeeze" well.  I don't believe this
jumps out at you in the docs.  I've seen people attempt bind a
java.util.Date to a DirectLink parameter on a high volume app.....the
results were bad.  :-)

Things like Strings, Integers, Maps, or other light-weight objects are good
candidates.

Cheers,
e.


----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, February 17, 2004 2:37 PM
Subject: Re: DirectLink question


> My guess is Event is not Serializable.
>
> If Event is a large object, it is best not to use it as a DirectLink
> parameter (even though that seems mighty convenient).  Use the primary
> key or something like that instead.
>
> Erik
>
> On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:
>
> > Ok, So after reviewing the code that everyone sent on the CRUD stuff
> > earlier I embarked on implementing said functionality. Looking at
> > ExternalLink (this was used in one of the examples) and DirectLink, I
> > decided to go with DirectLink.
> >
> > I use a ForEach on the rows to loop through my Events. That value is
> > stored in setEvent(). I successfully have each event name and date
> > showing up in my listing and I have a DirectLink setup for editing.
> > The DirectLink looks like this:
> > <a jwcid="@DirectLink" listener="ognl:listeners.editEventAction"
> > parameters="ognl:event">Edit Event</a>
> >
> > This resides in a foreach that has a value="ognl:event". The error
> > that I am getting when I try to load this page now (it was working
> > before I added the DirectLink code) is -
> > Could not find an adaptor for class com.sandcast.Event.
> >
> > Any help is greatly appreciated.
> >
> > -warner
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: DirectLink question

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
My guess is Event is not Serializable.

If Event is a large object, it is best not to use it as a DirectLink 
parameter (even though that seems mighty convenient).  Use the primary 
key or something like that instead.

	Erik

On Feb 17, 2004, at 2:18 PM, Warner Onstine wrote:

> Ok, So after reviewing the code that everyone sent on the CRUD stuff 
> earlier I embarked on implementing said functionality. Looking at 
> ExternalLink (this was used in one of the examples) and DirectLink, I 
> decided to go with DirectLink.
>
> I use a ForEach on the rows to loop through my Events. That value is 
> stored in setEvent(). I successfully have each event name and date 
> showing up in my listing and I have a DirectLink setup for editing. 
> The DirectLink looks like this:
> <a jwcid="@DirectLink" listener="ognl:listeners.editEventAction" 
> parameters="ognl:event">Edit Event</a>
>
> This resides in a foreach that has a value="ognl:event". The error 
> that I am getting when I try to load this page now (it was working 
> before I added the DirectLink code) is -
> Could not find an adaptor for class com.sandcast.Event.
>
> Any help is greatly appreciated.
>
> -warner
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: DirectLink question

Posted by Jamis Buck <jg...@email.byu.edu>.
Warner Onstine wrote:

>
> I use a ForEach on the rows to loop through my Events. That value is 
> stored in setEvent(). I successfully have each event name and date 
> showing up in my listing and I have a DirectLink setup for editing. 
> The DirectLink looks like this:
> <a jwcid="@DirectLink" listener="ognl:listeners.editEventAction" 
> parameters="ognl:event">Edit Event</a>
>
> This resides in a foreach that has a value="ognl:event". The error 
> that I am getting when I try to load this page now (it was working 
> before I added the DirectLink code) is -
> Could not find an adaptor for class com.sandcast.Event.
>

I'm coming in new to this discussion, so if my answer makes no sense, I 
apologize.  However, I believe the problem is that the DirectLink tries 
to encode the parameters, and there is no Adapter registered with the 
DataSqueezer that knows how to encode/decode the given event object.  
However, I know there is a SerializationAdapter--what if you made the 
Event object serializable?

-- 
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck.org/blog/jamis.cgi

ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'


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


Re: DirectLink question

Posted by Eric Schneider <er...@centralparksoftware.com>.
Warner,

I believe there is a Tapestry requirement that your "com.sandcast.Event"
class must implement Serializable.  You can find details in the
documentation related to the DataSqueezer object if you search hard enough.

There are two options.

1) make your Event class implement Serializable.
2) or change the direct link "parameters" attribute to a value that uniquely
identifies the Event object.

For example, maybe your Event object has a method called getId() that
returns an object of type Integer (which does implement Serializable).

parameters="ognl:event.id"

In your action method you can re-inflate your event object based on its id.

public void someAction(IRequestCycle cycle) {
 Object[] parameters = cycle.getServiceParameters();
 Integer eventId = (Integer)parameters[0];
 // some code to reinflate event by event id.
 .....
}

Hope this helps,
Eric.

----- Original Message ----- 
From: "Warner Onstine" <sw...@warneronstine.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, February 17, 2004 2:18 PM
Subject: DirectLink question


> Ok, So after reviewing the code that everyone sent on the CRUD stuff
> earlier I embarked on implementing said functionality. Looking at
> ExternalLink (this was used in one of the examples) and DirectLink, I
> decided to go with DirectLink.
>
> I use a ForEach on the rows to loop through my Events. That value is
> stored in setEvent(). I successfully have each event name and date
> showing up in my listing and I have a DirectLink setup for editing. The
> DirectLink looks like this:
> <a jwcid="@DirectLink" listener="ognl:listeners.editEventAction"
> parameters="ognl:event">Edit Event</a>
>
> This resides in a foreach that has a value="ognl:event". The error that
> I am getting when I try to load this page now (it was working before I
> added the DirectLink code) is -
> Could not find an adaptor for class com.sandcast.Event.
>
> Any help is greatly appreciated.
>
> -warner
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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