You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jiju <ji...@ibsplc.com> on 2007/01/18 15:37:48 UTC

@Persist problem in MyBasepage

Hi All,
I have one persistat property in my basepage , i am extending this basepage
to specificPages
will that persistant data be available in my derived pages also ?

public abstract MyBasePage extends BasePage implements
PageBeginRenderListener{
@Persist
public abstract UserContext getUserContext();
public abstract void  setUserContext();

public final void pageBeginRender(PageEvent event) {
setUserContext(new UserContext());			
doSomething(event);
			
}
public abstract void doSomething(PageEvent event);
};



public abstract DerivedPage extends MyBasePage{

public void doSomething(PageEvent event){
	System.out.println("UserContext="+getUserContext());
}

};
But here i am getting UserContext as null;

is it the right way to do, or am i missing any thing else..
-- 
View this message in context: http://www.nabble.com/%40Persist-problem-in-MyBasepage-tf3034507.html#a8431813
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Re: Re: @Persist problem in MyBasepage

Posted by Tapestry User List <my...@gmail.com>.
i meant:

    public void pageBeginRender(PageEvent event) {
        super.pageBeginRender(event);
    }

2007/1/18, Tapestry User List <my...@gmail.com>:
> and if you add this method in your subclass :
>
>     public void pageValidate(PageEvent event) {
>         super.pageValidate(event);
>     }
>
> I think that should work.
>
> All the best,
>
> D.
>
> 2007/1/18, Stephane Decleire <sd...@cariboo-networks.com>:
> > Hi,
> >
> > Yes, your persistent properties will be available in all your subclasses.
> > You could also init your persistent property with an @InitialValue
> > annotation.
> >
> > --
> > Stéphane Decleire
> >
> >
> >
> > jiju a écrit :
> > > Hi All,
> > > I have one persistat property in my basepage , i am extending this basepage
> > > to specificPages
> > > will that persistant data be available in my derived pages also ?
> > >
> > > public abstract MyBasePage extends BasePage implements
> > > PageBeginRenderListener{
> > > @Persist
> > > public abstract UserContext getUserContext();
> > > public abstract void  setUserContext();
> > >
> > > public final void pageBeginRender(PageEvent event) {
> > > setUserContext(new UserContext());
> > > doSomething(event);
> > >
> > > }
> > > public abstract void doSomething(PageEvent event);
> > > };
> > >
> > >
> > >
> > > public abstract DerivedPage extends MyBasePage{
> > >
> > > public void doSomething(PageEvent event){
> > >       System.out.println("UserContext="+getUserContext());
> > > }
> > >
> > > };
> > > But here i am getting UserContext as null;
> > >
> > > is it the right way to do, or am i missing any thing else..
> > >
> >
> >
>

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


Re: Re: @Persist problem in MyBasepage

Posted by Tapestry User List <my...@gmail.com>.
and if you add this method in your subclass :

    public void pageValidate(PageEvent event) {
        super.pageValidate(event);
    }

I think that should work.

All the best,

D.

2007/1/18, Stephane Decleire <sd...@cariboo-networks.com>:
> Hi,
>
> Yes, your persistent properties will be available in all your subclasses.
> You could also init your persistent property with an @InitialValue
> annotation.
>
> --
> Stéphane Decleire
>
>
>
> jiju a écrit :
> > Hi All,
> > I have one persistat property in my basepage , i am extending this basepage
> > to specificPages
> > will that persistant data be available in my derived pages also ?
> >
> > public abstract MyBasePage extends BasePage implements
> > PageBeginRenderListener{
> > @Persist
> > public abstract UserContext getUserContext();
> > public abstract void  setUserContext();
> >
> > public final void pageBeginRender(PageEvent event) {
> > setUserContext(new UserContext());
> > doSomething(event);
> >
> > }
> > public abstract void doSomething(PageEvent event);
> > };
> >
> >
> >
> > public abstract DerivedPage extends MyBasePage{
> >
> > public void doSomething(PageEvent event){
> >       System.out.println("UserContext="+getUserContext());
> > }
> >
> > };
> > But here i am getting UserContext as null;
> >
> > is it the right way to do, or am i missing any thing else..
> >
>
>

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


Re: @Persist problem in MyBasepage

Posted by jiju <ji...@ibsplc.com>.
yes, that is working am getting the value of usercontext in Derivedclass

but if i am setting usercontext [setUserContext(new usercontext());] in
pageAttached() event 
the usercontext is null  in the next request onwords




Stephane Decleire wrote:
> 
> Hi,
> 
> Yes, your persistent properties will be available in all your subclasses.
> You could also init your persistent property with an @InitialValue 
> annotation.
> 
> --
> Stéphane Decleire
> 
> 
> 
> jiju a écrit :
>> Hi All,
>> I have one persistat property in my basepage , i am extending this
>> basepage
>> to specificPages
>> will that persistant data be available in my derived pages also ?
>>
>> public abstract MyBasePage extends BasePage implements
>> PageBeginRenderListener{
>> @Persist
>> public abstract UserContext getUserContext();
>> public abstract void  setUserContext();
>>
>> public final void pageBeginRender(PageEvent event) {
>> setUserContext(new UserContext());			
>> doSomething(event);
>> 			
>> }
>> public abstract void doSomething(PageEvent event);
>> };
>>
>>
>>
>> public abstract DerivedPage extends MyBasePage{
>>
>> public void doSomething(PageEvent event){
>> 	System.out.println("UserContext="+getUserContext());
>> }
>>
>> };
>> But here i am getting UserContext as null;
>>
>> is it the right way to do, or am i missing any thing else..
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/%40Persist-problem-in-MyBasepage-tf3034507.html#a8443855
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: @Persist problem in MyBasepage

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Hi,

Yes, your persistent properties will be available in all your subclasses.
You could also init your persistent property with an @InitialValue 
annotation.

--
Stéphane Decleire



jiju a écrit :
> Hi All,
> I have one persistat property in my basepage , i am extending this basepage
> to specificPages
> will that persistant data be available in my derived pages also ?
>
> public abstract MyBasePage extends BasePage implements
> PageBeginRenderListener{
> @Persist
> public abstract UserContext getUserContext();
> public abstract void  setUserContext();
>
> public final void pageBeginRender(PageEvent event) {
> setUserContext(new UserContext());			
> doSomething(event);
> 			
> }
> public abstract void doSomething(PageEvent event);
> };
>
>
>
> public abstract DerivedPage extends MyBasePage{
>
> public void doSomething(PageEvent event){
> 	System.out.println("UserContext="+getUserContext());
> }
>
> };
> But here i am getting UserContext as null;
>
> is it the right way to do, or am i missing any thing else..
>