You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniele Dellafiore <il...@gmail.com> on 2009/04/10 17:38:39 UTC

wicket:Interface TabbedPanel and INewBrowserWindowListener

Hi everyone, I have this situation: a TabbedPanel with 2 panels each
containing a form.
Each panel have aa checkbox that trigger the enable/disable status of
each component of the form. So I enter the panel, click the "enable"
checkbox and then I can edit and save and press a discard button.

The discard button execute a:

setResponsePage(getPage().getClass(), getPage().getPageParameters());

becouse I need to reload the same entity I was editing and tipically I
have a single parameters that is the ID of the entity.

The effect is that the page is still in the initial situation, with
editing disabled and every modification, of course, has not been
saved.

This works in the first Tab of the TabbedPanel. In the second, what
happens is that fields values are reset but they do not go back to
disabled status. The reason I think is that instead of just the entity
ID I also found this pageParameter:

wicket:interface = "wicket-7:0:7:INewBrowserWindowListener::"

I am pretty sure that is related to the TabbedPanel but cannot
understand how. If I remove that parameter, the behavior is what
expected: page is restarted and I am back to the first tab with fields
disabled.

Two question:
1. when and why that parameter is added? I would like to read more
about wicket:interface and friends, can you point me to some doc?
2. What if I would like to reload the page on the same tab I was
before? You think is better to call a setSelectedTab before the
setResponsePage or to pass a pageParameter with the number of the
selected tab? Or what else?

Thanks.

-- 
Daniele Dellafiore
http://blog.ildella.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket:Interface TabbedPanel and INewBrowserWindowListener

Posted by Daniele Dellafiore <il...@gmail.com>.
It seems to be related to TabbedPanel in fact when I switch to
AjaxTabbedPanel, the parameter is no longer added.

I did some debug and what happens is that in the method
RequestCycle.urlFor(Component, RequestListenerIntercface, ValueMap)
the process goes into the first if branch and the line

target = new BookmarkableListenerInterfaceRequestTarget(...) is called
and the parameters added.

AjaxTabbedPanel solved this.

And also solved another issue I had. In the page with the TabbedPanel
I have a link that executes js history.back();
The intended behavior is to go back to the previous page but with the
TabbedPanel it goes back to the previous tab.
AjaxTAbbedPanel seems to be "fully ajaxified" so the history.back
returns to the previous rendered Page.

I think that this behavior is also related to the way we mount pages,
with a HybridUrlCodingStrategy. In fact on the location bar we have
the version number of the page and with AjaxTabbedPanel it does not
change while it changes with the TabbedPanel

Related to this I have some other issues but I open a new thread,
leaving this to understand the wicket:interface problem.

I am using wicket 1.3.3.

On Fri, Apr 10, 2009 at 5:44 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> that parameter is only added when wicket thinks you opened a new
> browser window or tab. it has nothing to do with tabbed panel. have
> you done that? this code is based on window.name attribute so if you
> have some js that changes the value it may confuse wicket.
>
> -igor
>
> On Fri, Apr 10, 2009 at 8:38 AM, Daniele Dellafiore <il...@gmail.com> wrote:
>> Hi everyone, I have this situation: a TabbedPanel with 2 panels each
>> containing a form.
>> Each panel have aa checkbox that trigger the enable/disable status of
>> each component of the form. So I enter the panel, click the "enable"
>> checkbox and then I can edit and save and press a discard button.
>>
>> The discard button execute a:
>>
>> setResponsePage(getPage().getClass(), getPage().getPageParameters());
>>
>> becouse I need to reload the same entity I was editing and tipically I
>> have a single parameters that is the ID of the entity.
>>
>> The effect is that the page is still in the initial situation, with
>> editing disabled and every modification, of course, has not been
>> saved.
>>
>> This works in the first Tab of the TabbedPanel. In the second, what
>> happens is that fields values are reset but they do not go back to
>> disabled status. The reason I think is that instead of just the entity
>> ID I also found this pageParameter:
>>
>> wicket:interface = "wicket-7:0:7:INewBrowserWindowListener::"
>>
>> I am pretty sure that is related to the TabbedPanel but cannot
>> understand how. If I remove that parameter, the behavior is what
>> expected: page is restarted and I am back to the first tab with fields
>> disabled.
>>
>> Two question:
>> 1. when and why that parameter is added? I would like to read more
>> about wicket:interface and friends, can you point me to some doc?
>> 2. What if I would like to reload the page on the same tab I was
>> before? You think is better to call a setSelectedTab before the
>> setResponsePage or to pass a pageParameter with the number of the
>> selected tab? Or what else?
>>
>> Thanks.
>>
>> --
>> Daniele Dellafiore
>> http://blog.ildella.net/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Daniele Dellafiore
http://blog.ildella.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket:Interface TabbedPanel and INewBrowserWindowListener

Posted by Igor Vaynberg <ig...@gmail.com>.
that parameter is only added when wicket thinks you opened a new
browser window or tab. it has nothing to do with tabbed panel. have
you done that? this code is based on window.name attribute so if you
have some js that changes the value it may confuse wicket.

-igor

On Fri, Apr 10, 2009 at 8:38 AM, Daniele Dellafiore <il...@gmail.com> wrote:
> Hi everyone, I have this situation: a TabbedPanel with 2 panels each
> containing a form.
> Each panel have aa checkbox that trigger the enable/disable status of
> each component of the form. So I enter the panel, click the "enable"
> checkbox and then I can edit and save and press a discard button.
>
> The discard button execute a:
>
> setResponsePage(getPage().getClass(), getPage().getPageParameters());
>
> becouse I need to reload the same entity I was editing and tipically I
> have a single parameters that is the ID of the entity.
>
> The effect is that the page is still in the initial situation, with
> editing disabled and every modification, of course, has not been
> saved.
>
> This works in the first Tab of the TabbedPanel. In the second, what
> happens is that fields values are reset but they do not go back to
> disabled status. The reason I think is that instead of just the entity
> ID I also found this pageParameter:
>
> wicket:interface = "wicket-7:0:7:INewBrowserWindowListener::"
>
> I am pretty sure that is related to the TabbedPanel but cannot
> understand how. If I remove that parameter, the behavior is what
> expected: page is restarted and I am back to the first tab with fields
> disabled.
>
> Two question:
> 1. when and why that parameter is added? I would like to read more
> about wicket:interface and friends, can you point me to some doc?
> 2. What if I would like to reload the page on the same tab I was
> before? You think is better to call a setSelectedTab before the
> setResponsePage or to pass a pageParameter with the number of the
> selected tab? Or what else?
>
> Thanks.
>
> --
> Daniele Dellafiore
> http://blog.ildella.net/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org