erm, if all your OfferListModel do is have something in load() then
why do you subclass it instead of the LDM directly?
-igor
On Dec 5, 2007 9:57 AM, Sergio García <[EMAIL PROTECTED]> wrote:
>
>
> igor.vaynberg wrote:
> >
> > looks like your page has a reference to some huge object which causes
> > a problem when the page is serialzed - so maybe that loadable
> > detachable model of yours is not very detachable...
> >
> >
> > -igor
> >
>
>
>
> I don't know what i'm doing wrong. I have a abstract detachable model:
>
>
>
> private abstract class OfferListModel extends LoadableDetachableModel{
> @Override
> protected Object load() {
> String stateAsString = stateDropDown.getModelObjectAsString();
> Integer year = (Integer) yearDropDown.getModelObject();
> String userAsString = userDropDown.getModelObjectAsString();
>
> if (StaticComboLists.OFFER_STATE_ALL.equals(stateAsString)) {
> stateAsString = null;
> }
>
> if (StaticComboLists.USER_FILTER_ALL.equals(userAsString)) {
> userAsString = null;
> }else {
> userAsString = getSignInSession().getUser().getLogin();
> }
>
> OffersListParameters parameters =
> new OffersListParameters(userAsString, year, stateAsString);
>
> ClassifiedOffersList offersList =
> offersService.findOffers(parameters);
>
> return offersList;
> }
> }
>
> And eight implementations of it, like this one:
>
> private class BeingPreparedOfferListModel extends OfferListModel{
> private static final long serialVersionUID = -1772413039827980131L;
>
> @Override
> protected Object load() {
> ClassifiedOffersList offersList = (ClassifiedOffersList)
> super.load();
> return offersList.getBeingPrepared();
> }
> }
>
>
> Each instance is used like this:
>
> BeingPreparedOfferListModel beingPreparedOfferListModel =
> new BeingPreparedOfferListModel();
>
> beingPreparedContainer =
> new DisabledIfEmptyMarkupContainer("beingPreparedContainer",
> beingPreparedOfferListModel);
> beingPreparedContainer.add(new
> beingPreparedOfferListView("beingPreparedListView",beingPreparedOfferListModel));
>
> Where the ListView has a reference to a detachable model, and
> DisabledIfEmptyMarkupContainer has a reference also to the DetachableModel:
>
> public class DisabledIfEmptyMarkupContainer extends WebMarkupContainer{
>
> private static final long serialVersionUID = 8749215642567364820L;
> private LoadableDetachableModel model;
>
>
> public DisabledIfEmptyMarkupContainer(String id, LoadableDetachableModel
> model) {
> super(id);
> this.model = model;
> setOutputMarkupPlaceholderTag(true);
> }
>
>
> @SuppressWarnings("unchecked")
> @Override
> protected void onBeforeRender() {
> super.onBeforeRender();
> if (((Collection) model.getObject()).isEmpty()) {
> add(new VisibilityFalseAttributeModifier());
> }else {
> add(new VisibilityTrueAttributeModifier("block"));
> }
> model.detach();
>
> }
>
>
> }
>
>
> Is something wrong that i can't see?
>
>
>
> --
> View this message in context:
> http://www.nabble.com/OutOfMemoryError%3A-Java-heap-space-tf4950580.html#a14177105
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]