Is it possible to have an AjaxLink to pass parameters as BookmarkableLinkPage class does?

2010-03-23 Thread Fernando Wermus
Hi all,
I can pass a parameter in a BookmarkablePage to the page called. But, I
think I cannot do the same with a page and an AjaxLink.

*Use case to solve*

There is a Link instance that reference to a page that renders an entity.
This entity is loaded getting the entity id from the page parameter.

This situation is repeated in an AjaxLink + Page that renders this entity.

*Problem*

If the ajax link is in a stateless page, for instance a page that receives
parameters; I got an expired session.


I would like to solve this use case with ajax and without ajax with the same
design, but I cant. This is because of reusing panel or components needs.


The only way to solve this is instead of using parameters, using the session
to store the entity. But the thing I dislike is that this entity live in the
request scope attribute. No longer.


Am I missing something?




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Is it possible to have an AjaxLink to pass parameters as BookmarkableLinkPage class does?

2010-03-23 Thread Ernesto Reinaldo Barreiro
Why donĀ“t you simply:

1-Put your entity related logic on a Panel.
2-On bookmarcable page scenario read details regarding the entity from page
parameter and use them to create panel in 1.
3-On AJAX scenario just use the link to create the panel in 1 based on
whatever information is contained on the link serving to recreate the entity
(e.g its primary key)

Regards,

Ernesto

On Tue, Mar 23, 2010 at 7:01 AM, Fernando Wermus
fernando.wer...@gmail.comwrote:

 Hi all,
I can pass a parameter in a BookmarkablePage to the page called. But, I
 think I cannot do the same with a page and an AjaxLink.

 *Use case to solve*

 There is a Link instance that reference to a page that renders an entity.
 This entity is loaded getting the entity id from the page parameter.

 This situation is repeated in an AjaxLink + Page that renders this entity.

 *Problem*

 If the ajax link is in a stateless page, for instance a page that receives
 parameters; I got an expired session.


 I would like to solve this use case with ajax and without ajax with the
 same
 design, but I cant. This is because of reusing panel or components needs.


 The only way to solve this is instead of using parameters, using the
 session
 to store the entity. But the thing I dislike is that this entity live in
 the
 request scope attribute. No longer.


 Am I missing something?




 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus