Author: ivaynberg Date: Thu Apr 19 15:16:02 2007 New Revision: 530568 URL: http://svn.apache.org/viewvc?view=rev&rev=530568 Log: better automatic decision making as to what add to the ajax target
Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java?view=diff&rev=530568&r1=530567&r2=530568 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java (original) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java Thu Apr 19 15:16:02 2007 @@ -25,6 +25,7 @@ import org.apache.wicket.markup.html.navigation.paging.IPagingLabelProvider; import org.apache.wicket.markup.html.navigation.paging.PagingNavigation; import org.apache.wicket.markup.html.navigation.paging.PagingNavigator; +import org.apache.wicket.markup.repeater.AbstractRepeater; /** * A Wicket panel component to draw and maintain a complete page navigator, @@ -146,21 +147,19 @@ // markup container. Component container = ((Component)pageable); - if ((pageable instanceof MarkupContainer) && !(pageable instanceof ListView)) + // no need for a nullcheck as there is bound to be a non-repeater + // somewhere higher in the hierarchy + while ((container instanceof AbstractRepeater)) { - container = (MarkupContainer)pageable; - } - else - { - container = ((Component)pageable).findParent(MarkupContainer.class); + container = container.getParent(); } target.addComponent(container); - + // in case the navigator is not contained by the container, we have // to add it to the response if (((MarkupContainer)container).contains(this, true) == false) { target.addComponent(this); - } + } } }