You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mindbridge <mi...@yahoo.com> on 2003/03/16 21:10:20 UTC

Re: SqueezeAdaptor question

Hi,

>   I'm tring to use Table component. But when i use my object which is
>   not implementing Serialiazble.
>   I get an exception "Could not find an adaptor for class
com.clearview.feedback.db.report.FeedbackCategory.".
>   I've created adaptor for this class.

You are using the new table 'form' components :) Cool.

>   1. Should i create every time for my custom objects such adaptors?

At the moment, I am afraid so (unless your table model does not return
primary keys). This will probably change imminently, since it is an obvious
issue.

>   2. Can somebody explain the procedure of registering these adaptors.

Create your own engine by overriding BaseEngine and override the
createDataSqueezer() method.
Register the adaptor there, e.g. like this:

public DataSqueezer createDataSqueezer()
{
    return new DataSqueezer(_resolver, new ISqueezeAdaptor[] { /* put your
adaptors here */ });
}

>        <component id="tableRows" type="contrib:TableFormRows">
>                 <binding name="row" expression="bean.currentCategory"/>
>        </component>
>        When i use my custom adapter, tapestry tries to invoke method
>             setCurrentCategory(String ...)

Is it possible for FeedbackCategory.getCategoryByName(s, null); or some
other part of the code to return String rather than FeedbackCategory?
TableFormRows works like ListEdit, it will set in the row binding the
unsqueezed value of the object that was stored in the form. The class of
that value depends on the unsqueezing process.

If you are still having problems, try using TableRows rather than
TableFormRows -- it may be easier. In the mean time I will try to make the
conversion process mentioned above easier and will add more docs.

-mb


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