Thanks for your answers.

I set the multi window support settings to true, and that did not make a
difference. Interestingly, the javadoc shows that multiwindow support is
true by default. I also tried setting it to false, with no luck.

However, setting the response to a new page on click seems to conserve the
original page usability. My guess is because a new page is then created, so
the current page is still valid, and the elements on it are still valid.

I am trying a bookmarkable page link instead of the onclick event, which
seems to work, except that the AJAX actions (example paging) in the original
page return an expired page message.

Still investigating, if anyone has more information it will be greatly
appreciated.
I am working in migrating an existing large JSP/Servlet/Struts app to
Wicket, and the pattern, that is open new detail windows or tabs from a AJAX
list, is heavily used by our customers. So I have to find a way to solve
this issue without limiting existing functionality. Sadly, I am pretty new
to wicket, so I dont know the internals of why a page should loses its
containers or expires in this cases.

-Nelson

On Wed, Jun 30, 2010 at 11:14 AM, Branislav Kalas <bka...@gmail.com> wrote:

> and i forgot this in the onclick handler :
> @Override
> protected void onClick() {
>         setResponsePage(new HomePage(parameters));
>
>         System.out.println("clicked on link");
> }
>
> On 06/30/2010 07:59 PM, Branislav Kalas wrote:
>
>> Put this into WicketApplication.java
>>  @Override
>>    protected void init() {
>>        super.init();
>>        getPageSettings().setAutomaticMultiWindowSupport(true);
>>    }
>>
>> Problem was, that you opened new windows in same page map.
>> I cannot explain it better cause, i don't understand page maps very
>> well...
>>
>> On 06/30/2010 07:40 PM, Nelson Segura wrote:
>>
>>> I am attaching a Quickstart project to help reproduce the problem.
>>> On the home page, middle click in the email address shown (usually this
>>> will take a user to a detail page, but in this case it just prints a
>>> message). After that, any click on a link in the page will cause a component
>>> not found exception.
>>>
>>> Thanks for all your help.
>>>
>>> -Nelson
>>>
>>>
>>>
>>> On Wed, Jun 30, 2010 at 9:18 AM, Nelson Segura <nsegu...@gmail.com<mailto:
>>> nsegu...@gmail.com>> wrote:
>>>
>>>    Can anyone explain to me why this does not work with
>>>    AjaxFallbackDefaultDataTable, but does with DefaultDataTable.
>>>    Does anyone know of a solution for this problem?
>>>
>>>
>>>    On Mon, Jun 28, 2010 at 6:18 PM, Nelson Segura
>>>    <nsegu...@gmail.com <mailto:nsegu...@gmail.com>> wrote:
>>>
>>>        Since AjaxLink is AJAX and not a proper link, then it does
>>>        behave as a normal link, i.e. middle click (open link in new
>>>        tab or new window) does not trigger the AJAX click even,
>>>        which means you cannot chose to open the link in a new page.
>>>
>>>        back to square one, except that know I know is a problem with
>>>        AjaxFallbackDefaultDataTable, not with DataTable.
>>>
>>>
>>>        -Nelson
>>>
>>>
>>>        On Mon, Jun 28, 2010 at 5:47 PM, Nelson Segura
>>>        <nsegu...@gmail.com <mailto:nsegu...@gmail.com>> wrote:
>>>
>>>            Jeremy, the code is below.
>>>
>>>            I did notice something while researching/testing more.
>>>            The LinkPanel solution DOES work for a DataTable. The
>>>            problem starts when changed to a
>>>            AjaxFallbackDefaultDataTable.
>>>            I did testing based in the datatable example in the
>>>            wicket examples.
>>>            Maybe using an AjaxLink instead of a normal link in the
>>>            table is the right answer.
>>>
>>>
>>>            Code is mostly taken from the page linked in the original
>>>            email
>>>
>>>            public abstract class LinkPanel<T> extends Panel {
>>>
>>>                private static final long serialVersionUID =
>>>            2062173455224348354L;
>>>
>>>                public LinkPanel(final Item<?> item, final String
>>>            componentId,
>>>                        final IModel<T> model, final String property) {
>>>                    super(componentId, model);
>>>
>>>                    AjaxLink<T> link = new AjaxLink<T>("linkCell") {
>>>
>>>                        private static final long serialVersionUID =
>>>            2574434147588617330L;
>>>
>>>                        @Override
>>>                        public void onClick(AjaxRequestTarget target) {
>>>                            LinkPanel.this.onClick();
>>>                        }
>>>
>>>
>>>                    };
>>>                    add(link);
>>>                    link.add(new Label("label", new
>>>            PropertyModel(model,property)));
>>>                }
>>>
>>>                protected abstract void onClick();
>>>            }
>>>
>>>            ----------------- Usage ---------------
>>>
>>>            public class LinkPanelPage extends WebPage {
>>>
>>>                public LinkPanelPage() {
>>>            Form form = new Form("form");
>>>                    final LinkPanelListProvider provider = new
>>>            LinkPanelListProvider();
>>>                    List<IColumn> columnList = new ArrayList<IColumn>(3);
>>>                    //columnList.add(new PropertyColumn(new
>>>            Model("eMailAddress"),"eMailAddress"));
>>>                    columnList.add(new AbstractColumn(new
>>>            Model("eMailAddress"), "eMailAddress") {
>>>                        private static final long serialVersionUID =
>>>            -1822504503325964706L;
>>>
>>>                        @Override
>>>                        @SuppressWarnings("unchecked")
>>>                        public void populateItem(Item cellItem,
>>>            String componentId, final IModel rowModel) {
>>>                            cellItem.add(new LinkPanel(cellItem,
>>>            componentId, rowModel, getSortProperty()) {
>>>
>>>                                private static final long
>>>            serialVersionUID = -4615958634366803506L;
>>>
>>>                                @Override
>>>                                protected void onClick() {
>>>                                    System.out.println("clicked on
>>>            link");
>>>                                }
>>>                            });
>>>                        }
>>>
>>>                    });
>>>
>>>                    columnList.add(new PropertyColumn(new
>>>            Model("firstName"),"firstName"));
>>>                    columnList.add(new PropertyColumn(new
>>>            Model("lastName"),"lastName"));
>>>                    AjaxFallbackDefaultDataTable table = new
>>>            AjaxFallbackDefaultDataTable("link-panel-table",
>>>            columnList, provider, 3);
>>>                    form.add(table);
>>>                    add(form);
>>>            }
>>>            }
>>>
>>>            -Nelson
>>>
>>>
>>>            On Mon, Jun 28, 2010 at 5:14 PM, Jeremy Thomerson
>>>            <jer...@wickettraining.com
>>>            <mailto:jer...@wickettraining.com>> wrote:
>>>
>>>                please show some code
>>>
>>>                On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura
>>>                <nsegu...@gmail.com <mailto:nsegu...@gmail.com>> wrote:
>>>
>>>                > I am trying to create a table based on DataTable,
>>>                in which one of the
>>>                > columns has links on it.
>>>                > I tried to use the strategy described here (LinkPanel):
>>>                >
>>>                >
>>>
>>> https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
>>>                >
>>>                > But this has a problem: clicking in the links in
>>>                succession soon causes
>>>                > "component not found exceptions", or opening the
>>>                link in a new window or
>>>                > tab
>>>                > renders the current page unusable, with the same
>>>                exception.
>>>                >
>>>                > rg.apache.wicket.WicketRuntimeException: component
>>>                ..... not found on page
>>>                > ...
>>>                >     at
>>>                >
>>>
>>>  
>>> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
>>>                >     at
>>>                >
>>>
>>>  
>>> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
>>>                >     at
>>>                >
>>>
>>>  
>>> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
>>>                >     at
>>>
>>>  org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>>>                > ...
>>>                >
>>>                > I believe this is due to the fact that a new
>>>                LinkPanel is created when
>>>                > rendering each column cell, and that when the click
>>>                happens, the current
>>>                > LinkPanels are replaced by new ones, and so the
>>>                original page is not usable
>>>                > anymore, because it is referring to the original
>>>                LinkPanels.
>>>                >
>>>                > Our users make heavy use of opening links in a list
>>>                in new pages or tabs,
>>>                > so
>>>                > this is a big deal for us :(
>>>                >
>>>                > Is there any solution for this problem? The only
>>>                one I can think of is to
>>>                > use AjaxLink instead, but I am not sure whether
>>>                that is correct, or if it
>>>                > could cause even more problems.
>>>                >
>>>                > Any help?
>>>                >
>>>                > -Nelson
>>>                >
>>>
>>>
>>>
>>>                --
>>>                Jeremy Thomerson
>>>                http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, 
>>> e-mail:users-unsubscr...@wicket.apache.org<e-mail%3ausers-unsubscr...@wicket.apache.org>
>>> For additional commands, 
>>> e-mail:users-h...@wicket.apache.org<e-mail%3ausers-h...@wicket.apache.org>
>>>
>>
>>
>

Reply via email to