Hi Nick,

Thanks a lot.

I've added persistent="yes" and it is working.

<property-specification name="user"
type="com.fujitsu.efi.infringement.model.EfiUser" persistent="yes"/>


Naz

-----Original Message-----
From: Nick Westgate [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 24 July 2007 5:30 p.m.
To: Tapestry users
Subject: Re: T3: loosing the User object as soon as the edit action is
invoked?

How is the User object persisted?
(What relates to it in your UserEdit.page file?)

Cheers,
Nick.


Nazmul Bhuiyan wrote:
> I'm loosing the User object as soon as the edit action is invoked?
> 
> I'm setting an object (e.g. User) in page UserMaint.java to the page
> UserEdit.java.
> 
> UserMaint.java
> 
> public void userEditAction(IRequestCycle cycle) {
> UserEdit nextPage = (UserEdit) cycle.getPage("UserEdit");
>       Object[] parameters = cycle.getServiceParameters();
>       int id = ((Integer) parameters[0]).intValue();
> 
>       EfiUser user = EfiUserDAO.getEfiUserById(id);
>               
>       nextPage.setUser(user);
>       nextPage.setNewUser(false);
>       cycle.activate(nextPage);
> }
> 
> In pageBeginRender method of UserEdit shows the User object with all
the
> attributes:
> 
> UserEdit.java
> 
> public abstract void setUser(EfiUser user);
> public abstract EfiUser getUser()
> 
> public void pageBeginRender(PageEvent event) {
> 
>   if (!getNewUser() && !event.getRequestCycle().isRewinding()) {
>                       
> System.out.println("Inside pageBeginRender..................");
> System.out.println("user: " + getUser());
> System.out.println("ID: " + getUser().getUsrUserId());
>       .
>       .
>       etc
>   }                   
> }
> 
>>From Debug:
> Inside pageBeginRender..................
> user: [EMAIL PROTECTED]
> ID: 1
> 
> But in the updateUser method the User object is different and the
fields I
> don't want to update are null.
> 
> UserEdit.java
> 
> public void updateUser(IRequestCycle cycle) {
>       System.out.println("In updateUser");
> 
>       IValidationDelegate delegate = getValidationDelegate();
> 
>       //HibernateUtil.restartSession();
> 
>       System.out.println("Inside updateUser..................");
> System.out.println("user: " + getUser());
> System.out.println("ID: " + getUser().getUsrUserId());
>       .
>       .
>       etc     
> }
> 
>>From Debug:
> Inside updateUser..................
> user: [EMAIL PROTECTED]
> ID: 0
> 
> Please help.
> 
> Naz

---------------------------------------------------------------------
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]

Reply via email to