Page 1 of 1

No TextBox CallBack

Posted: 15 Jan 2021, 08:22
by SenlyCamile
I run the "Samples.Login" with IOS,and add a "TouchUp" event callback to TextBox.But after touchdown the textbox,the callback method is not entered.
MainWindow::MainWindow()
{
	......
	Noesis::TextBox* userbox=FindName<Noesis::TextBox*>("UserBox");
	userbox->TouchUp()+=MakeDelegate(this,&MainWindow::boxTouchUp);
}
void MainWindow::boxTouchUp(Noesis::BaseComponent* sender, const Noesis::TouchEventArgs& e)
{
	.......
}

Re: No TextBox CallBack

Posted: 15 Jan 2021, 11:26
by SenlyCamile
Sorry,there is "TouchUp" event no callback,notTouchDown.

Re: No TextBox CallBack

Posted: 15 Jan 2021, 13:23
by sfernandez
Hi, there is an issue in our application framework (#1833) that is preventing TouchUp events to raise in the appropriate elements.

You can workaround that by disabling manipulations on the Window once loaded:
MainWindow::MainWindow()
{
    Initialized() += MakeDelegate(this, &MainWindow::OnInitialized);
    InitializeComponent();

    Loaded() += [this](BaseComponent*, const RoutedEventArgs&)
    {
        SetIsManipulationEnabled(false);
    };
}
On a side note, I guess it is a typo but FindName shouldn't have a pointer as template parameter, just the type:
Noesis::TextBox* userbox = FindName<Noesis::TextBox>("UserBox");

Re: No TextBox CallBack

Posted: 16 Jan 2021, 09:27
by SenlyCamile
Hi, there is an issue in our application framework (#1833) that is preventing TouchUp events to raise in the appropriate elements.

You can workaround that by disabling manipulations on the Window once loaded:
MainWindow::MainWindow()
{
    Initialized() += MakeDelegate(this, &MainWindow::OnInitialized);
    InitializeComponent();

    Loaded() += [this](BaseComponent*, const RoutedEventArgs&)
    {
        SetIsManipulationEnabled(false);
    };
}
On a side note, I guess it is a typo but FindName shouldn't have a pointer as template parameter, just the type:
Noesis::TextBox* userbox = FindName<Noesis::TextBox>("UserBox");
Thanks for your help,but now after "SetIsManipulationEnabled(false)", the box can't respond GotFocus or LostFocus.
Example:I touched textbox1,and the textbox1 GotFocus,then I touched passwordbox or textbox2,passwordbox and textbox2 are not GotFocus,and textbox1 is not LostFocus.
If I touch blank space after touch textbox1,then touch textbox2 or passwordbox,both can GotFocus after textbox1 LostFocus.

Re: No TextBox CallBack

Posted: 18 Jan 2021, 16:18
by sfernandez
Nothing wrong on your side, it seems there is a different issue (#1887). When handling TouchUp, Tapped or Holding events, next touch down events are not properly promoted to mouse down events, so controls are not correctly focused.

We'll fix it for the next release.