I'm not sure why the children disappear but it looks odd to me to save
component in the session in first place.

why not:
if (request.getParameter("editMode")) { label = new AjaxEditableLabel(id,
model);} else {label = new Label(id, model);}
parent.addOrReplace(label);

?

On Thu, Sep 23, 2010 at 12:24 PM, 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
>>>
>>
>>
>>
>

Reply via email to