Skip to content

Commit

Permalink
ZK-5480: Cascader doesn't display selected item if set before render …
Browse files Browse the repository at this point in the history
…after ZK-5414
  • Loading branch information
DevChu authored and jumperchen committed Jan 16, 2024
1 parent 7008252 commit e8c7a8d
Show file tree
Hide file tree
Showing 4 changed files with 32 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 @@ -31,6 +31,7 @@ ZK 10.0.0
ZK-5593: inputWidget bind_ accesses input dom node may not exist
ZK-5605: client-bind fails for zk.$extends created widget classes, without ClientBindComposer declared
ZK-5603: Client-mvvm boolean false handling is different from server-side
ZK-5480: Cascader doesn't display selected item if set before render after ZK-5414

* Upgrade Notes
+ Upgrade commons-fileupload to commons-fileupload2-javax 2.0.0-M1 and commons-io to 2.13.0 to support jakarta-friendly uploads
Expand Down
14 changes: 14 additions & 0 deletions zktest/src/main/webapp/test2/B100-ZK-5480.zul
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>
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 @@ -3117,6 +3117,7 @@ B90-ZK-4431.zul=A,E,Multislider
##zats##B100-ZK-5529.zul=A,E,Tree,focus
##zats##B100-ZK-5593.zul=A,E,Listbox,InputWidget,JSError
##zats##B100-ZK-5605.zul=A,E,clientbind,widget
##zats##B100-ZK-5480.zul=A,E,cascader,selection,label

##
# Features - 3.0.x version
Expand Down
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());
}
}

0 comments on commit e8c7a8d

Please sign in to comment.