PageActivationContext issue

2013-08-22 Thread nn kk
 Hi,
I have the following code:
class Page1 {

  @InjectPage
  private Page2 page2;
  ...

  Object onSuccessFrom...() {
...
ListCat catList = new ArrayList...
catList.add(cat1);
catList.add(cat2);

page2.setCatList(catList);
return page2;
  }
}

class Page2 {
   @PageActivationContext
   @Property(write = false)
   private ListCat catList;

   public void setBaList(ListCat catList) {
 this.catList= catList;
   }

   void onActivate() {
//catList is null   
   }

   void onActivate(ListCat catList)
   {
//catList is null   
   }

  void setupRender() {
//catList is null   
  }
}


If I replace @PageActivationContext with @Persist, I see the list populated, 
but I don't understand how should I use the @PageActivationContext 


-
Само сега спечели смартфон SAMSUNG и още много награди!виж
http://www.specheli.eu/specheli-textgbg.php

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



Re: PageActivationContext issue

2013-08-22 Thread Lance Java
I think I had issues trying to use an array / collection as an EventContext
item. I think I had to resort to using a comma separated string from
memory.
On 22 Aug 2013 15:03, nn kk inv...@abv.bg wrote:

  Hi,
 I have the following code:
 class Page1 {

   @InjectPage
   private Page2 page2;
   ...

   Object onSuccessFrom...() {
 ...
 ListCat catList = new ArrayList...
 catList.add(cat1);
 catList.add(cat2);

 page2.setCatList(catList);
 return page2;
   }
 }

 class Page2 {
@PageActivationContext
@Property(write = false)
private ListCat catList;

public void setBaList(ListCat catList) {
  this.catList= catList;
}

void onActivate() {
 //catList is null
}

void onActivate(ListCat catList)
{
 //catList is null
}

   void setupRender() {
 //catList is null
   }
 }


 If I replace @PageActivationContext with @Persist, I see the list
 populated, but I don't understand how should I use the
 @PageActivationContext


 -
 Само сега спечели смартфон SAMSUNG и още много награди!виж
 http://www.specheli.eu/specheli-textgbg.php

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




Re: PageActivationContext issue

2013-08-22 Thread Lance Java
In your case, I think you will be able to fix it by.

1. Remove @PageActivationContext
2. Add onActivate(EventContext ec)
3. Add ListCat onPassivate()

On 22 Aug 2013 15:18, Lance Java lance.j...@googlemail.com wrote:

 I think I had issues trying to use an array / collection as an
EventContext item. I think I had to resort to using a comma separated
string from memory.