Titanium - How to avoid losing focus on TextField when a label is updated within the same ListItem - titanium

I have a ListSection that contains a list of products that can be purchased.
For each product it is possible to indicate the price and quantity via TextFields.
When one of these TextFields is modified (onChange event), a label indicating the total to be paid for the product must be updated.
When this label is updated, the focus on the input text is lost and the keyboard is removed.

Related

Get the count of words that spills out of the view react native

I have a view which basically shows selected car's brands as text inside the view. But I want the count of the remaining car's brand whenever the text overflows the parent view.
See the image below for more info
see image
I tried using onLayout of text to calculate the max character count that can fit in the view but that doesn't work properly. Any help on this?

TornadoFX: Layout of listview shifts if content is modified

I have a ListView inside of a TornadoFX form builder field that can be added to and removed from by some buttons off to the side. However whenever the contents of the list is modified from the buttons, the list moves vertically downwards. The height of the ListView remains the same, but it's almost as if there is padding being generated along the top whenever the content length is modified. The height change is then reset as soon as there is some change in focus, either by clicking on another component in the view, or by unfocussing and refocussing the window.
I've tried to limit the ability for this to happen by enforcing a max height, both on the form field and on the ListView itself, but neither worked.
Using listeners to print out all the values I could think of that would result in this change, I found that the "bounds in Parent" were changing, adding a value of 17 to both the minY and maxY values. I've not been able to determine where this value of 17 comes from.
The current code for the view is here: https://pastebin.com/6qFVvxvP
I also have some images to help visualize what the problem is:
Before removing content:
After removing content:

Adding Tick to ListView Items QT

I have a custom QAbstractListModel and I use it for ListView to show images. My question is how can I add red tick (as shown in the picture) on specific items without changing original image?

Handling selections across multipe XAML User control

I have multiple user controls in my page. Initially I set the border thickness to zero for all the user controls.
When the user selects a particular control instance through mouse or touch events, I want the border to be shown with specific thickness.
Later when the mouse moves out of the control or when the user selects another control instance I want the border to be shown for this newly selected control and reset the border thickness to zero for the previously selected control.
How can I achieve this in XAML?

WP7 Get visible items in listbox

I have a listbox in a WP7 application and I would like to retrieve a list of visible items in the listbox. Actually, I am trying to retrieve the object that is visible so that when my application is tombstoned, I can resume it and write listbox.ScrollIntoView(lastVisibleItem);
If it matters, listbox is bound to a collection of custom objects with a datatemplate for customizing the way it looks.
Thanks in advance.
It's possible to work out how far the list has been scrolled using the technique detailed in this answer.
You could then calculate which item(s) are displayed based on the size of the list and the height of the items displayed.
If different items can be diffferent sizes then this becomes more difficult as you need to consider the height of each individual item.
You also need to remember that only part of an item may be displayed.