-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
ZK-5777: sendRedirect() doesn't work because of the encoded &
1 parent
a5cd7b5
commit 4dde1bc
Showing
5 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
B101-ZK-5777.zul | ||
Purpose: | ||
Description: | ||
History: | ||
2024/10/29, Created by jumperchen | ||
Copyright (C) 2024 Potix Corporation. All Rights Reserved. | ||
--> | ||
<zk> | ||
<zscript><![CDATA[ | ||
Object v1 = Executions.getCurrent().getParameter("param1"); | ||
Object v2 = Executions.getCurrent().getParameter("param2"); | ||
public void redirect() { | ||
Executions.getCurrent().sendRedirect("B101-ZK-5777.zul?param1=value1¶m2=value2"); | ||
// Executions.getCurrent().sendRedirect("B101-ZK-5777.zul?param1=value1¶m2=value2", "_self"); workaround | ||
} | ||
]]></zscript> | ||
<label value="param1: ${v1}" /> | ||
<label value="param2: ${v2}" /> | ||
<button label="redirect with parameters" onClick="redirect()"/> | ||
</zk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
zktest/src/test/java/org/zkoss/zktest/zats/test2/B101_ZK_5777Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* B101_ZK_5777Test.java | ||
Purpose: | ||
Description: | ||
History: | ||
10:12 AM 2024/10/29, Created by jumperchen | ||
Copyright (C) 2024 Potix Corporation. All Rights Reserved. | ||
*/ | ||
package org.zkoss.zktest.zats.test2; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import org.zkoss.test.webdriver.WebDriverTestCase; | ||
|
||
/** | ||
* @author jumperchen | ||
*/ | ||
public class B101_ZK_5777Test extends WebDriverTestCase { | ||
@Test | ||
public void test() { | ||
connect(); | ||
click(jq("@button")); | ||
waitResponse(); | ||
assertEquals("param1: value1", jq("@label:eq(0)").text()); | ||
assertEquals("param2: value2", jq("@label:eq(1)").text()); | ||
} | ||
} |