-
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.
ZK-5480: Cascader doesn't display selected item if set before render …
…after ZK-5414
- Loading branch information
1 parent
7008252
commit e8c7a8d
Showing
4 changed files
with
32 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<zk xmlns:h="native"> | ||
<h:h1>Basic</h:h1> | ||
<zscript><![CDATA[ | ||
DefaultTreeModel treeModel = new DefaultTreeModel(new DefaultTreeNode("ROOT", | ||
Arrays.asList(new DefaultTreeNode[]{ | ||
new DefaultTreeNode("USA", Arrays.asList(new TreeNode[]{new DefaultTreeNode("New York"),new DefaultTreeNode("Los Angelas")})), | ||
new DefaultTreeNode("Japan", Arrays.asList(new TreeNode[]{new DefaultTreeNode("Tokyo"),new DefaultTreeNode("Kyoto")})), | ||
new DefaultTreeNode("New Zealand", Arrays.asList(new TreeNode[]{new DefaultTreeNode("Auckland"),new DefaultTreeNode("Queenstown")})) | ||
}) | ||
)); | ||
treeModel.addToSelection(treeModel.getChild(new int[]{1, 1})); | ||
]]></zscript> | ||
<cascader id="cas" width="300px" model="${treeModel}"/> | ||
</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
16 changes: 16 additions & 0 deletions
16
zktest/src/test/java/org/zkoss/zktest/zats/test2/B100_ZK_5480Test.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,16 @@ | ||
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; | ||
|
||
public class B100_ZK_5480Test extends WebDriverTestCase { | ||
@Test | ||
public void test() { | ||
connect(); | ||
waitResponse(); | ||
assertEquals("Japan/Kyoto", jq(".z-cascader-label").text()); | ||
} | ||
} |