tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandr Kundirenko <akundire...@gmail.com>
Subject Beta-5. Page loading logic changed?
Date Thu, 01 Sep 2005 14:36:35 GMT
Hello All,

I have persistent property which I want to initialize using
another property value.

Page spec:

        <property name="itemClass" initial-value="literal:research.model.SomeObject"/>

Page class:

        /**
         * Item which is initialized using value of #getItemClass
         */
         @Persist
         public abstract IPersistable getItem();
         public abstract void setItem(IPersistable item);

In beta-4 I tried to do it in finishLoad:

        /**
         * @see org.apache.tapestry.AbstractComponent#finishLoad()
         */
         @Override
         protected void finishLoad() {
            super.finishLoad();
            //itemClass is NOT initialized at this point!
            setItem(getNewFormItemInstance());
         }

But for some reason after super.finishLoad() call "itemClass" property
still WAS NOT initialized with intial-value. (Is it OK?)
I examined sources and found another place for it, which worked:

        /**
         * @see org.apache.tapestry.AbstractComponent#enterActiveState()
         */
        @Override
        public void enterActiveState() {                
            super.enterActiveState();
            //worked in beta-4
            setItem(getNewFormItemInstance());
        }

But in beta-5 changes to propeties which are made in
enterActiveState() are reset in some magic way... I'm trying to find
where for a few hours. I set item in enterActiveState() and it is back
to NULL in pageBeginRender(). Is it normal behaviour?

Thank you,
  aku


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


Mime
View raw message