Dialog close without selecting the value into text fields on on Simulator - codenameone

I use the dialog to display date range control. On Simulator before selecting the value dialog closes and I'm not able to change or update any value. Please see the code below. Please advise if there is any known issue.

This is probably related to this line:
range.setDisposeWhenPointerOutOfBounds(true);
When you start interacting with the Picker popup, it disposes the dialog because the pointer it outside the bounds of the underlying dialog.
I have made a change to Dialog that will be available in the next update on Friday that will fix this issue.
https://github.com/codenameone/CodenameOne/commit/2c5fbfc9ae06e35911b5832441a685724e9739a0

Related

How can i Show multiple markLines on hover in echarts-for-react

With the use of the tooltip formatter function, I can display numerous marklines when the user hovers over them. I set the state that has to be updated to display the marklines in this function, and it works fine. However, when I zoom in, since the status is set when I hover on the chart, it continuously redraws and becomes invisible when I move my pointer.
I have tried setting the options using getEchartsInstance().setOptions() but i got errors saying 'Instance has been disposed, cannot find a connection'
If i am not using state then the markLine data will not get updated.
Another way I thought of was to use the same event handler that is used to show axisPointer , but i couldn't find any such function.
Thank you in advance.

Detect press of "cancel" on a Codename One lightweight date picker

On a Codename One lightweight date pickers, the user has four buttons in the top, like in the following screenshot.
I suppose the tapping of the second, third and fourth buttons are detected by the .addActionListener() (please correct me if I'm wrong)... but I need to detected also the tapping of the "Cancel" button. How can I run some code when the user taps "Cancel"?
We don't provide a way to detect cancel since we can't consistently detect it on native. As a workaround you can listen to the click on the picker button and unless you get a selection it would mean that the action was canceled.
Alternatively we can add a feature like this for the lightweight picker only. If you need that you can file an RFE on that.
I overcame this by comparing the newly selected picker value to the previously stored value. If it’s the same, I consider it a cancel.

Select box automatically opens on clicking button in Chrome Android and Chrome Responsive Mode using IONIC FRAMEWORK

Short description of the problem:
I have a form in which a group of fields in repeated based on an array of objects.
There is a button which pushes an object into the array. So the user can add as many groups as he like one by one.
There is a select box as the first element of this group.
However, upon clicking the button, the select box is opened automatically after the new group appears.
Steps to reproduce:
1. Visit http://52.66.117.243/app-test/ for testing.
2. Scroll down and click on add more button.
3. The new select box for title automatically opens
Chrome in responsive mode is also able to reproduce the problem
I think the issue might be due to the click event passed on to the newly added select box since the position w.r.t screen of the button is occupied by the new select element. However, I cannot be very sure.
Interestingly, a small timeout before adding of the new elements seems to solve the problem.
If the problem is indeed the click event being propagated, can someone be kind enough to explain what is causing it, event bubbling/capturing on the ng-click or something else ?
Thank you.

how can I know how a popup menu was closed?

I have a WPF DatePicker, and like any datepicker, it has a built-in calendar that you can open by clicking on the small calendar icon.
this calendar is put in a popup menu, so that it behaves like one, i.e.: once it is opened, there are 2 ways to close it:
Validate you choice (click on a date with the mouse, hit "Enter" with a date highlighted, etc...)
cancel (hit "Echap", click outside the popup, etc...)
My problem is, I need to know which one was used, and I can't seem to find a way to do this.
Right now I listen to the "CalendarClosedEvent" but it doesn't tell me How the calendar was closed.
I also used the "PreviewKeyDownEvent" to trap the "Echap" key, which works well, except it does not cover the case when the user clicks outside the calendar to close it.
Is there a way to do this? if so, what is it?
(NB: I'd be happy with a generic answer about the popup menu object and not the calendar object in the datePicker)
For the DatePicker at least, you can set the SelectedDate to null (which is actually the default so, just leave it). Then the SelectedDateChanged fires any time the user clicks inside the control.
This is the only thing I could find to mark a difference. Hope it helps.

Show NotifyIcon Context Menu and Control Its Position?

I'm trying to show a context menu when I left-click a NotifyIcon. Just calling NotifyIcon.ContextMenuStrip.Show() doesn't work very well. A solution has been posted here before that calls a secret method using Reflection:
Dim mi As System.Reflection.MethodInfo = GetType(NotifyIcon).GetMethod("ShowContextMenu", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
mi.Invoke(Icon, Nothing)
This works great, except that I also need to control where the menu is shown. I want to wait for the SystemInformation.DoubleClickTime to elapse between receiving the NotifyIcon.MouseUp event and displaying the menu, so that I can handle single-clicks and double-clicks separately. But invoking the ShowContextMenu method displays the menu at the current mouse position when ShowContextMenu is called, not when the icon was actually clicked. Which means that if the mouse moved during the DoubleClickTime, the menu will be displayed in a different part of the screen. So if I can control where the menu is shown, I can just save the mouse coordinates when I receive the MouseUp event, and then I can ensure that the menu is displayed near the icon. Is there a way to do this?
Thanks in advance.
Well, I just discovered that there are existing programs that exhibit this same behavior. I just went through all the icons in my system tray and about half of them do it. If you left-click the icon and then move the mouse during the delay before the menu appears, the menu will appear at the last mouse location, wherever that is on the screen. Snagit is one application that does this. Outlook is the only program in my tray that always shows the menu where I clicked the icon. But Snagit looks like it's using a .NET ContextMenuStrip, while Outlook is probably using a native menu.
So either this is standard behavior, or it's a problem that no one else has been able to solve either. And as a user, I've never noticed this behavior until yesterday when I was testing my own application. So I guess it's not that big of a deal and I won't worry about it.

Resources