Page 1 of 1

a TabControl bug

Posted: Sun Aug 21, 2016 11:47 pm
by holyping
I tested the version downloaded on 22 Oct.
the XAML as below:

Code: Select all

<Page
    x:Class="ht5test.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ht5test"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <TabControl>
        <TabItem Header="aaa">
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <StackPanel>
                    <DataGrid x:Name="_grid" Grid.Row="0" AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding f1}" Header="f1"/>
                            <DataGridTextColumn Binding="{Binding f2}" Header="f2"/>
                            <DataGridTextColumn Binding="{Binding f3}" Header="f3"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Grid Height="67" Grid.Row="1">
                        <Button x:Name="_bt" Content="Button" HorizontalAlignment="Left" Margin="9,14,0,0" VerticalAlignment="Top" Width="75" Click="button_Click"/>
                        <TextBlock x:Name="_txt" Text="Button"  HorizontalAlignment="Left" Margin="9,50,0,0" VerticalAlignment="Top"  />
                    </Grid>
                </StackPanel>
            </ScrollViewer>
        </TabItem>
        <TabItem Header="bb">
            <TextBlock>aabbbss</TextBlock>
        </TabItem>
    </TabControl>
</Page>


and the code is below

Code: Select all

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace ht5test
{
    public partial class MainPage : Page
    {
        ObservableCollection<DItem> _data = new ObservableCollection<DItem>();
        public MainPage()
        {
            this.InitializeComponent();

            for (int i = 0; i < 3; i++)
            {
                _data.Add(new DItem() { f1 = "aa" + i, f2 = "bb", f3 = "cc" });
            }
            _grid.ItemsSource = _data;
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            _data.Add(new DItem() { f1 = "aa", f2 = "bb", f3 = "cc" });
            _txt.Text = string.Join(", ", _data.Select(x => x.f1).ToArray());
        }
    }
    class DItem
    {
        public string f1 { get; set; }
        public string f2 { get; set; }
        public string f3 { get; set; }
    }
}



it reports error when I switched the two tabs in 2 times.
and another bug is when the program starts, the initial view does not show the first tab

Re: a TabControl bug

Posted: Mon Aug 22, 2016 3:54 am
by JS-Support @Userware
Hi and welcome to the forums.

Thanks for reporting this issue. We are going to fix it in the coming weeks (Beta 9.2 or 9.3).

Regards,
JS-Support

Re: a TabControl bug

Posted: Mon Oct 10, 2016 3:15 am
by JS-Support @Userware
Hi,

The issue has been fixed in Beta 10.1, available from:
http://forums.cshtml5.com/viewforum.php?f=6

Thanks.
Regards,
JS-Support

Re: [SOLVED] a TabControl bug

Posted: Tue Oct 11, 2016 5:57 am
by Sesztak
Dear JS-Support,

for your kind information the TabControl is better, but some other bug still exist:

Symptoms:
-Two TabItem get stucked: "two blue line" / like two tabitems selected at the same time:

CSHTML5_10.1TabsStucked.JPG
CSHTML5_10.1TabsStucked.JPG (10.46 KiB) Viewed 8456 times


-Unhandled exception:
"Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."

function INTERNAL_HtmlDomManager_RemoveOptionFromNativeComboBox (optionToRemove, nativeComboBoxDomElement) {
nativeComboBoxDomElement.removeChild(optionToRemove);
};

Please, double check it ! -can you reproduce the bug ?
Really waiting for your solution as actually the only workaround with multiple tabitem to reload the whole page :(((

Thanks in advance,
Best Regards,
Péter

Re: [SOLVED] a TabControl bug

Posted: Tue Oct 11, 2016 6:07 am
by JS-Support @Userware
Sesztak wrote:for your kind information the TabControl is better, but some other bug still exist:
...
-can you reproduce the bug ?

Hi Péter,

Thanks for your message. The TabControl in the sample Showcase application (under the "Controls" section) appears to work fine, as well as those in our tests. Could you please send me a code snippet to reproduce the issue?

Thanks.

Re: a TabControl bug

Posted: Tue Oct 11, 2016 6:57 am
by Sesztak
Dear JS-Support,

Do not joke with me !!: if you put only one TextBlock on a TabItem - yes, you are right !: no problem at all,

But: It's clearly written in our previous message:
""Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."

function INTERNAL_HtmlDomManager_RemoveOptionFromNativeComboBox (optionToRemove, nativeComboBoxDomElement) {
nativeComboBoxDomElement.removeChild(optionToRemove);
};
"

So, the the the only thing you do should have to do: just put a ComboBox with some data.
(instead of asking me to do the same ! :!: )

Anyway, no problem I did the home work :D :

XAML:
<Page
x:Class="CSHTML5_removeChildOnNode_BUG.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CSHTML5_removeChildOnNode_BUG"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Canvas>
<TabControl>
<TabItem Header="tabItem A">
<ComboBox x:Name="comboBox1" Margin="6,0,0,0" Padding="3" DisplayMemberPath="Name"/>
</TabItem>
<TabItem Header="tabItem B">
<TextBlock Text="Go back to 'tabItem A' and play with 'comboBox1' => Bug arrived ! "/>
</TabItem>
</TabControl>
</Canvas>
</Page>

C#:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace CSHTML5_removeChildOnNode_BUG
{
public partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
ObservableCollection<DataSample> _DataSample = new ObservableCollection<DataSample>() {
new DataSample() {Name ="Emil" },
new DataSample() {Name ="Peter" }
};
comboBox1.ItemsSource = _DataSample;
}

class DataSample
{
public string Name { get; set; }
}
}
}

How to reproduce the bug:
1./ First TabItem select some item from combobox,
2./ Select the other tabitem ("tabItem B"),
3./ Go back to first tabitem: you got exception.


I really hope it helps to fix the bug !

please, confirm: can you reproduce the bug ?

Waiting for your kind reply,
Br,
Péter