Author: almaw Date: Mon Jun 4 11:43:43 2007 New Revision: 544204 URL: http://svn.apache.org/viewvc?view=rev&rev=544204 Log: WICKET-607 partial fix - make QueryStringUrlCodingStrategy understand listener targets.
Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/BookmarkablePageRequestTargetUrlCodingStrategy.java incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/BookmarkablePageRequestTargetUrlCodingStrategy.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/BookmarkablePageRequestTargetUrlCodingStrategy.java?view=diff&rev=544204&r1=544203&r2=544204 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/BookmarkablePageRequestTargetUrlCodingStrategy.java (original) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/BookmarkablePageRequestTargetUrlCodingStrategy.java Mon Jun 4 11:43:43 2007 @@ -35,7 +35,7 @@ AbstractRequestTargetUrlCodingStrategy { /** bookmarkable page class. */ - private final Class bookmarkablePageClass; + protected final Class bookmarkablePageClass; /** page map name. */ private final String pageMapName; Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java?view=diff&rev=544204&r1=544203&r2=544204 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java (original) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java Mon Jun 4 11:43:43 2007 @@ -21,12 +21,16 @@ import java.util.TreeMap; import java.util.Map.Entry; +import org.apache.wicket.IRequestTarget; import org.apache.wicket.PageMap; +import org.apache.wicket.PageParameters; import org.apache.wicket.protocol.http.UnitTestSettings; +import org.apache.wicket.request.RequestParameters; +import org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget; +import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget; import org.apache.wicket.util.string.AppendingStringBuffer; import org.apache.wicket.util.value.ValueMap; - /** * Encodes and decodes mounts for a single bookmarkable page class, but with the * parameters appended in a URL query string rather than integrated into a URL @@ -138,6 +142,22 @@ encoder.addValue(entry.getKey().toString(), entry.getValue()); } } + } + } + + public IRequestTarget decode(RequestParameters requestParameters) + { + String pageMapName = requestParameters.getPageMapName(); + final PageParameters parameters = new PageParameters(requestParameters.getParameters()); + + if (requestParameters.getInterfaceName() != null) { + return new BookmarkableListenerInterfaceRequestTarget(pageMapName, + bookmarkablePageClass, parameters, requestParameters.getComponentPath(), + requestParameters.getInterfaceName()); + } + else + { + return new BookmarkablePageRequestTarget(pageMapName, bookmarkablePageClass, parameters); } }