You really don't want to save a component in a session. A component has
its own lifecycle, tied to pagerequests, and its own scope tied to its
parent components and the page it is part of. From what I understand of
your story, what you should do is write your own component that wraps a
Label or an AjaxEditLabel depending on some condition/mode. This is very
easy to make with wicket.

On Thu, 23 Sep 2010 13:24 +0300, "Mihai Postelnicu"
<[email protected]> wrote:
> Guys,
> I work on the same project as below (integrating an interface translator 
> with Wicket) and we are a bit stuck. Any ideas?
> 
> Thanks in advance for your time !
> Mihai
> 
> On 09/23/2010 12:29 PM, Alexandru Artimon wrote:
> >  Forgot to mention that the component is an AjaxEditableLabel and I 
> > need to save it to session because I'm creating a custom wicket tag 
> > for translation purposes. When in translator mode I want all the 
> > labels to be replaced by AjaxEditableLabel's so that the translator 
> > can do his job easier.
> >
> > The problem I have is that when I click on the label of the 
> > AjaxEditableLabel, it produces an ajax request in order to change 
> > visibility modes and show the edit box. I did my custom tag replacing 
> > by implementing an IComponentResolver, which (from what I figured) 
> > happens on render. So my AjaxEditableLabel component isn't in the page 
> > when the Ajax request arrives. I planned to solve this by fetching the 
> > missing component from the session on my own, by overwriting 
> > resolveListenerInterfaceTarget. Now when I fetch the original 
> > AjaxEditableLabel from the session, all it's children (the Label and 
> > TextField) are gone.
> >
> > Any ideas will be much appreciated.
> >
> > Thanks,
> > Alexandru
> >
> >
> >
> > On 09/23/2010 11:57 AM, Alexandru Artimon wrote:
> >> Hello,
> >>
> >> I have a problem when saving a component to the session, all it's 
> >> children disappear.
> >> I do the save like this:
> >>
> >>     session.bind();
> >>     session.setMetaData(MY_KEY, component);
> >>
> >>
> >> Regards,
> >> Alexandru
> >
> >
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to