Skip to content

Commit

Permalink
ZK-5696: Nested Shadow element fails in ZK 10
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen committed Sep 9, 2024
1 parent eb20a95 commit 720f183
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ZK 10.1.0
ZK-5784: a fontawesome bug causes zk to lose all styles in Chrome and Edge
ZK-5659: Tree only renders 50 nodes in client mvvm
ZK-5677: Executions.schedule cause infinite loop if async event causes exception
ZK-5696: Nested Shadow element fails in ZK 10

* Upgrade Notes
+ Remove Htmls.encodeJavaScript(), Strings.encodeJavaScript(), Strings.escape() with Strings.ESCAPE_JAVASCRIPT, and replace them with OWASP Java Encoder APIs instead.
Expand Down
32 changes: 32 additions & 0 deletions zktest/src/main/webapp/test2/B101-ZK-5696.zul
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
B101-ZK-5696.zul
Purpose:
Description:
History:
2024/9/9, Created by jumperchen
Copyright (C) 2024 Potix Corporation. All Rights Reserved.
-->
<zk>
<zscript><![CDATA[
int counter = 0;
ListModelList items = new ListModelList();
]]></zscript>
<div apply="org.zkoss.bind.BindComposer">
<forEach items="@init(items)">
<div>
<label value="${each}"/>
<if test="@init(true)">
conditional
</if>
</div>
</forEach>
</div>
<button onClick="items.add(++counter)" label="add"/>
</zk>
1 change: 1 addition & 0 deletions zktest/src/main/webapp/test2/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3131,6 +3131,7 @@ B90-ZK-4431.zul=A,E,Multislider
##zats##B101-ZK-5659-1.zul=A,E,ClientMVVM,Tree,Model,ROD
##zats##B101-ZK-5659-2.zul=A,E,ClientMVVM,Tree,Model,ROD
##zats##B101-ZK-5677.zul=A,E,Scheduler,Event,Exception
##zats##B101-ZK-5696.zul=A,E,NestedShadow,ServerMVVM,ForEach,Differ

##
# Features - 3.0.x version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* B101_ZK_5696Test.java
Purpose:
Description:
History:
11:58 AM 2024/9/9, 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_5696Test extends WebDriverTestCase {
@Test
public void test() {
connect();
for (int i = 0; i < 5; ) {
click(jq(".z-button"));
waitResponse();
assertEquals(1, jq(".z-label:contains(" + ++i + ")").length());
assertEquals(i, jq(".z-label:contains(conditional)").length());
}
}
}

0 comments on commit 720f183

Please sign in to comment.