<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Courier New",serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Courier New",serif">I just want to add one thing - the initial state of
</span><span style="font-family:"Courier New",serif">RadioMenuItems added to a menu is unselected, even if they belong to a ToggleGroup.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">One can say that having all unselected radio buttons in a toggle group makes no sense, or perhaps it depends on the application requirements - though I cannot find an example where it might
be needed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">So either we allow two different policies by adding a property to the ToggleGroup, or we proclaim that adding a radio button to a toggle group must have a side effect of one (first) button to
be automatically selected, otherwise the whole group is in inconsistent state (or the app developer must write some code to select one).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">-andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Kevin Rushforth <kevin.rushforth@oracle.com><br>
<b>Date: </b>Friday, 2023/01/20 at 12:27<br>
<b>To: </b>openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br>
<b>Subject: </b>Re: RFC: new property in ToggleGroup<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">How common a UI feature is being able to deselect the selected item in a ToggleGroup via the UI such that no item is selected? I don't normally see that in various apps or toolkits that I am familiar with. What
I do see is that either a default item is selected or no item is selected initially (which is the one and only time that there will be no item selected), but in both case, once you make a selection, there is no way via the UI to deselect the current item.
Absent a compelling need, I think the current behavior (once the fix for JDK-8237505 is integrated) is sufficient.<br>
<br>
What do other developers think?<br>
<br>
-- Kevin<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 1/20/2023 11:31 AM, Andy Goryachev wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-family:"Courier New",serif">Dear colleagues:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">In the context of a recent PR
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><a href="https://bugs.openjdk.org/browse/JDK-8237505">https://bugs.openjdk.org/browse/JDK-8237505</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><a href="https://github.com/openjdk/jfx/pull/1002">https://github.com/openjdk/jfx/pull/1002</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"><a href="https://stackoverflow.com/questions/57911107/javafx-togglegroup-not-functioning-properly-with-accelerators-radiomenuitem">https://stackoverflow.com/questions/57911107/javafx-togglegroup-not-functioning-properly-with-accelerators-radiomenuitem</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">where a number of RadioMenuItems belonging to a toggle group are added to the menu, we might want to add a new property to the ToggleGroup which controls whether all items in a group can be
deselected.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">If this property is set, a selected radio menu item can be deselected via either keyboard accelerator or a mouse click. If not, then not only this operation cannot be performed, but also the
first item added to said ToggleGroup gets automatically selected.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">This should allow for more flexibility in creating menus with RadioMenuItems, but eliminate some boilerplate code required in such cases.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">The new logic would also affect any Toggle, such as ToggleButton.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">What do you think? Thank you.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">-andy</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>