You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fernando Wermus <fe...@gmail.com> on 2010/03/23 07:01:09 UTC

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

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?

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
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
<fe...@gmail.com>wrote:

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