Thanks, that reminds me to look at wicket 2 before I start asking questions. Forgot to do that this time.

On 9/19/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
in 2.0 IDataProvider extends IDetachable. in 1.x it still supports it although it doesnt implement it directly (so we can stay backwards compatible), so you have to do it yourself

class MyDataProvider extends SortableDataProvider implements IDetachable

here is the snippet from dataviewbase.ondetach()

protected void onDetach()
    {
        super.onDetach();
        if (dataProvider instanceof IDetachable)
        {
            ((IDetachable)dataProvider).detach();
        }
    }

-Igor


On 9/19/06, Erik Brakkee < [EMAIL PROTECTED]> wrote:
Hi,


I have a situation where I use a domain object as the source for a dataprovider. So to get the list of items for the data provider I am actually querying the domain object like:

    manager.getArtists();

Since the manager is a persistent object, I need to refresh it from the database. In my application I have worked around it by providing a Detachable<T> interface that allows transparent retrieval of the object:

public interface Detachable<T> extends Serializable {
   
    /**
     * Detaches the object.
     */
    void detach();
   
    /**
     * Gets the object, attaching it if needed.
     * @return
     */
    T get();

}

Now, I have two implementations of this:
1. an inmemory version that doest not detach (it is inmemory)
2. a hibernate version that always fetches the object using   Session.load(). Effectively using the hibernate cache.

In both cases, I am not depending on wicket calling attach or detach. When I looked at how to use the wicket functionality, I found that IDataProvider does not have attach() and detach(). Shouldn't there be an IDetachableDataProvider interface as well with attach() and detach() so that I can also use this wicket attach/detach functionality in a data provider?

Cheers
  Erik

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to