Duplicate Items when using Scroll wheel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-10 1:42 PM
Setup:
- TouchGFX v4.23.0
- STM32H747
- Scroll wheel with selected item template
Issue:
I dynamically set the number of items in the scroll wheel using the function setNumberOfItems() so in the TouchGFX designer I set the Number of Items to 0. As an example, I am displaying 4 items but have 8 to choose from. When the scroll wheel is first shown, the first 4 items (index 0 - 3) are rendered correctly. When I push down, the screen correctly shifts and shows items 1 - 4. When I push down again, the first item (index 2) is shown in the first, selected position and is shown in the 4 position as well.
As I continue to navigate down in the list, sometimes there are other duplicates, sometimes the list is correct.
Workaround:
I tried a few different things but setting the Number of Items in the designer to 2 (I didn't try any other value) solved the duplicate glitch.
So it seems, that having the Number of Items set to 0 is what causes this issue in the first place.
Solved! Go to Solution.
- Labels:
-
TouchGFX
-
TouchGFX Designer
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 4:39 AM
Hello @brymat ,
Sorry for the late response,
I realized that you need to set the 'Number of Items' in the designer, as large as the number of visible elements in the designer or bigger. So, for instance, in the example that you have provided, you just need to set the number of elements to 5 in the beginning and then change it later.
The simulation working correctly
There should a bug that causes this behavior, in other words, there is a dependency on the first call to setNumberOfItems. We will dig into it more, and hopefully fix the issue as soon as possible. But, I hope the current solution can help you progress.
Good luck
ST Software Developer | TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-15 3:14 AM
Hello @brymat ,
I tried to replicate the issue you mentioned, but I was not successful. Is it possible for you to share a simple project that demonstrate the problem?
Thank you
ST Software Developer | TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-17 2:32 PM
Hello,
I have attached a simple example based on the Scroll Wheel example in TouchGFX and targeting the STM32H747I discovery kit.
If you switch to the "Scroll Wheel" option in the display, you will see the duplicated values in the list right away. Scrolling back and forth shows many odd values in the list. Although the selected value is always correct.
I have also attached a photo as an example. In the photo, I would have expected to see the values 22, 23, 24, not 22, 22, and 20.
 
Cheers,
Bryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-20 3:34 AM
i have had kind of similar issue in the past when using the "number picker" that has been shared in the past from an STEmployee.
Its number picker has two functions:ScrollWheelUpdateCenterItem and ScrollWheelUpdateItem
The first is for the "seeing" item and the other is for the not "seeing" items.
I guess you are not updating well the second (or equivalent) part/function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-26 11:23 PM - edited ‎2024-07-01 12:54 AM
I always set the item count in the TouchGFX Designer to a value higher than the visible item count to cope with this bug you mentioned.
Also, when changing the item count at runtime I always do:
setNumberOfItems(0);
setNumberOfItems(newValue);
To handle some update-problems. I don't remember the details anymore.
Edit: This can cause crashes in the Simulator MS Windows application. Please read the solution post of this thread for more details: https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/touchgfx-simulator-assertion-quot-timerwidget-registered-too/td-p/679316
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 4:39 AM
Hello @brymat ,
Sorry for the late response,
I realized that you need to set the 'Number of Items' in the designer, as large as the number of visible elements in the designer or bigger. So, for instance, in the example that you have provided, you just need to set the number of elements to 5 in the beginning and then change it later.
The simulation working correctly
There should a bug that causes this behavior, in other words, there is a dependency on the first call to setNumberOfItems. We will dig into it more, and hopefully fix the issue as soon as possible. But, I hope the current solution can help you progress.
Good luck
ST Software Developer | TouchGFX
