View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003429 | NoesisGUI | C++ SDK | public | 2024-06-24 05:50 | 2024-12-26 19:08 |
| Reporter | nikobarli | Assigned To | sfernandez | ||
| Priority | normal | Severity | major | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.2.3 | ||||
| Target Version | 3.2.7 | Fixed in Version | 3.2.7 | ||
| Summary | 0003429: RadioButton selection cannot be controlled correctly from code when using OneWay Binding. | ||||
| Description | Please find the patch to reproduce the problem below. The patch creates a group of two radio buttons and toggle the selection using a button. After clicking the button for several times, none of the buttons is selected, which is not the expected behavior. | ||||
| Steps To Reproduce | Please apply the attached patch, build Noesis solutions, and run the Commands project. | ||||
| Attached Files | Test_OneWayBinding.patch (2,921 bytes)
Index: Native/Src/Packages/Samples/Commands/Data/MainWindow.xaml
===================================================================
--- Native/Src/Packages/Samples/Commands/Data/MainWindow.xaml (revision 173884)
+++ Native/Src/Packages/Samples/Commands/Data/MainWindow.xaml (working copy)
@@ -19,7 +19,7 @@
Background="#801C1F21" BorderBrush="#40101611" BorderThickness="1" CornerRadius="5"
HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel Orientation="Vertical">
- <DockPanel>
+ <!--<DockPanel>
<TextBlock Text="Input:" Width="80" VerticalAlignment="Center"/>
<TextBox Text="{Binding Input, Mode=TwoWay}"/>
</DockPanel>
@@ -33,7 +33,12 @@
<Viewbox Height="50" Margin="0,20,0,0">
<TextBlock TextAlignment="Center" Text="{Binding Output}"
FontSize="28" Foreground="White"/>
- </Viewbox>
+ </Viewbox>-->
+
+ <RadioButton Content="1" IsChecked="{Binding Flag1, Mode=OneWay}"/>
+ <RadioButton Content="2" IsChecked="{Binding Flag2, Mode=OneWay}"/>
+ <Button Content="Test" Command="{Binding TestCmd}"/>
+
</StackPanel>
</Border>
</Viewbox>
Index: Native/Src/Packages/Samples/Commands/Src/Main.cpp
===================================================================
--- Native/Src/Packages/Samples/Commands/Src/Main.cpp (revision 173884)
+++ Native/Src/Packages/Samples/Commands/Src/Main.cpp (working copy)
@@ -26,6 +26,7 @@
using namespace Noesis;
using namespace NoesisApp;
+#pragma warning( disable : 4100 )
namespace Commands
{
@@ -37,6 +38,7 @@
ViewModel()
{
_command.SetExecuteFunc(MakeDelegate(this, &ViewModel::SayHello));
+ _testCmd.SetExecuteFunc(MakeDelegate(this, &ViewModel::ChangeFlag));
}
const char* GetInput() const
@@ -85,7 +87,27 @@
}
}
+ bool GetFlag1(void) const {
+ return _flag;
+ }
+ bool GetFlag2(void) const {
+ return !_flag;
+ }
+ const DelegateCommand* GetTestCmd() const
+ {
+ return &_testCmd;
+ }
+ void ChangeFlag(BaseComponent* param_)
+ {
+ _flag = !_flag;
+ OnPropertyChanged("Flag1");
+ OnPropertyChanged("Flag2");
+ }
+
private:
+ bool _flag = true;
+ DelegateCommand _testCmd;
+
DelegateCommand _command;
char _input[256] = "";
char _output[256] = "";
@@ -95,6 +117,10 @@
NsProp("Input", &ViewModel::GetInput, &ViewModel::SetInput);
NsProp("Output", &ViewModel::GetOutput, &ViewModel::SetOutput);
NsProp("SayHelloCommand", &ViewModel::GetSayHelloCommand);
+
+ NsProp("Flag1", &ViewModel::GetFlag1);
+ NsProp("Flag2", &ViewModel::GetFlag2);
+ NsProp("TestCmd", &ViewModel::GetTestCmd);
}
};
| ||||
| Platform | Windows | ||||
| related to | 0002434 | resolved | sfernandez | ToggleButton with one way binding |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2024-06-24 05:50 | nikobarli | New Issue | |
| 2024-06-24 05:50 | nikobarli | File Added: Test_OneWayBinding.patch | |
| 2024-06-24 12:38 | sfernandez | Relationship added | related to 0002434 |
| 2024-06-24 12:38 | sfernandez | Assigned To | => sfernandez |
| 2024-06-24 12:38 | sfernandez | Status | new => assigned |
| 2024-06-24 12:38 | sfernandez | Target Version | => 3.2.5 |
| 2024-10-24 16:43 | sfernandez | Target Version | 3.2.5 => 3.2.6 |
| 2024-11-22 18:18 | jsantos | Target Version | 3.2.6 => 3.2.7 |
| 2024-12-26 19:08 | sfernandez | Status | assigned => resolved |
| 2024-12-26 19:08 | sfernandez | Resolution | open => fixed |
| 2024-12-26 19:08 | sfernandez | Fixed in Version | => 3.2.7 |
| 2024-12-26 19:08 | sfernandez | Note Added: 0010228 |