0

Radiogroup possible bug

asked 2021-10-13 00:05:23 +0800

aUser gravatar image aUser
133 4

updated 2021-10-13 00:23:19 +0800

Hello,

I created this fiddle. The scenario is like this:

I have a grid with N rows, one of the rows is "selected" and that is showed by the selected radio put on every row. All the radio's belong to a single Radiogroup.

For zk version 9.5.1.3 the statement

radio.setRadiogroup(group);

works just fine and the correct row is selected. However, updating zk to version 9.6.0 or 9.6.0.1, the same statement causes the Radiogroup to not have any radio selected. Is this a bug?

The workaround I'm using right now is by replacing the previous statement with

group.appendChild(radio);

since this one works for all the versions above.

Thanks


Instead of replacing, the second statement should be added, that way the selection would be unique in the group

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-10-13 11:42:33 +0800

cor3000 gravatar image cor3000
6168 2 7
ZK Team

this is likely a side effect of: ZK-4763

https://github.com/zkoss/zk/commit/f33b5451f683ae0c8cd51db2fa88504b124b9ef2#diff-aaede010309680332dae2b14b4e20d886b5902459c2ee2816f1968abb643fe7bR228-R232

As you can see in the commit it clears the previously assigned group when setting/changing the parent. I assume that's where it happens, I didn't debug through it. Here your updated example, first setting the parent, and then connecting the radio to the radiogroup.

https://zkfiddle.org/sample/32oj09m/2-Radiogroup-possible-bug-workaround#source-1

link publish delete flag offensive edit

Comments

Got it, thank you

aUser ( 2021-10-13 16:47:58 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2021-10-13 00:05:23 +0800

Seen: 6 times

Last updated: Oct 13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More