You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ronizedsynch <sa...@yahoo.com> on 2011/03/13 05:57:03 UTC

@Persist vs onActivate()

MasterPerson.java [partial]
@Persist
private Person person;

private Person personGrid;

public List getListPerson() {
   return getMasterFacade().getPersonDao().getPersonByFilter(getPerson()); 
}

void onSeletectedFromSearch(){ 
}

void onSeletectedFromSave(){ 
 getMasterFacade().getPersonDao().insert(gerPerson());
}

MasterPerson.tml















in this state:
the save button is fine work
the search button is fine work

Problem:
if I redirect to MasterPerson page it showing the person that has stored on
session.

I ever use onActivate() method

void onActivate(){
_resources.discardPersistentFieldChanges();
}

but that is caused the search button doesn't work

any idea ??
thank 4 all

Regard,
Rony



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Persist-vs-onActivate-tp3555214p3555214.html
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 vs onActivate()

Posted by ronizedsynch <sa...@yahoo.com>.
Hi Igor, it's work thank

I add a bit code to pageReset() method

void pageReset(){
 if (getPerson() != null)
 person = new Person();
}

:D

+++ man is man +++


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Persist-vs-onActivate-tp3555214p3556020.html
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 vs onActivate()

Posted by ronizedsynch <sa...@yahoo.com>.
Igor Drobiazko wrote:
> 
> If you are using 5.2, just rename your onActivate() method to pageReset().
> 

Hi Igor thank for ur response.

I tried pageReset() method but it's not delete the last session,

this is my track:

on my grid I have actionlink with personId as context..when I clicked this
actionlink its will fill some textfield that I defined on tml

input t:type="textfield" t:value="person.person.name"/

input t:type="textfield" t:value="person.person.address"/

search and reset button
input t:type="submit" t:id="search" value="Search"/
input t:type="submit" t:id="reset" value="Reset"/

link on grid 
a t:type="actionlink" t:id="edit"
t:context="${personGrid.personId}">${personGrid.person_name}</a


@Persist
private Person person;

void onActionFromEdit(String personId){
		this.person = getMasterFacade().getPersonDao().findByPrimaryKey(personId);
	}

void onActionFromSearch(){

}

void onActionFromReset(){
 this.person = new Person();
}

Problem: this person object still alive on session before I clicked reset
button 
Hope : clear person session but the search button still work

thank 4 ur responses


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Persist-vs-onActivate-tp3555214p3555882.html
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 vs onActivate()

Posted by Igor Drobiazko <ig...@gmail.com>.
If you are using 5.2, just rename your onActivate() method to pageReset().

It is strongly recommended to understand activation/passivation mechanism.
See here:

http://tapestry.apache.org/page-navigation.html

On Sun, Mar 13, 2011 at 5:57 AM, ronizedsynch <sa...@yahoo.com> wrote:

> MasterPerson.java [partial]
> @Persist
> private Person person;
>
> private Person personGrid;
>
> public List getListPerson() {
>   return getMasterFacade().getPersonDao().getPersonByFilter(getPerson());
> }
>
> void onSeletectedFromSearch(){
> }
>
> void onSeletectedFromSave(){
>  getMasterFacade().getPersonDao().insert(gerPerson());
> }
>
> MasterPerson.tml
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> in this state:
> the save button is fine work
> the search button is fine work
>
> Problem:
> if I redirect to MasterPerson page it showing the person that has stored on
> session.
>
> I ever use onActivate() method
>
> void onActivate(){
> _resources.discardPersistentFieldChanges();
> }
>
> but that is caused the search button doesn't work
>
> any idea ??
> thank 4 all
>
> Regard,
> Rony
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Persist-vs-onActivate-tp3555214p3555214.html
> 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
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: @Persist vs onActivate()

Posted by ronizedsynch <sa...@yahoo.com>.
my tml code :

form t:type="form"

input t:type="textfield" t:value="person.name"/

input t:type="textfield" t:value="person.address"/

input t:type="submit" t:id="save" value="Save" class="button"/
input t:type="submit" t:id="search" value="Search" class="button"/

/form

table t:type="grid" t:source="listPerson"  t:row="personGrid"
/table

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Persist-vs-onActivate-tp3555214p3555318.html
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