cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX : Scrolllist

APate.18
Associate III

Container Has 3 Widget (Box , 2 Button ) 

Container is used in scroll list , I have selectedHandler for Index but how can we get Which widget is selected form this itemIndex .

6 REPLIES 6

Hello @APate.18 ,

ScrollList is used for similar items, but you are planning to use different items. In this case, it's better to use Scrolable Container instead, and then using interactions for each button to implement your desired functionalities.
You can read more about Scrolable Containers here:
https://support.touchgfx.com/docs/development/ui-development/ui-components/containers/scrollable-container

Don't hesitate to ask more questions

Mohammad MORADI
ST Software Developer | TouchGFX

Hey MORADI ,

Thanks for reply

Actully i am using list of elements as i have attached one image

I have Few requirement for this

1) This List should be scrollable and list of item should decided on runtime

2) There are 3 different widgets in one container 

     i) Up arrow as a button 01

     ii) Down Arrow as a button 02

     iii) Box 

all 3 are tapeable

3) while we tapped on widget we require 

          i) Index of tapped item

          ii) which widget is tapped

for saving their state 

 

please let me know any solution for this i have tried scroll list but it wont work for saving state of tapped item differently because we get one index from handler 

its little bit urgent 

Hello

You can use callbacks to trigger parent (view) when some of those three widgets is pressed. Here is simple example, modified from some old example. I was lazy and use flex button as text box. You run it on simulator, it is made in version 4.21.4 but seems to work also on later versions.

Hopefully you get the idea out of it.

Br JTP

Hello again,

Based on the picture you have provided, I suggest you to create a Custom Container first, and handle the logic there (in other words, implement the function for updating the state inside to custom container class). Then, you can use a Scroll List with the custom container you created as its Item Template. You have to set the number of items and make sure the list is large enough to show all the available items (probably the list will go outside of the screen which is fine).
I have uploaded a photo to demonstrate how your scroll list should look like.

Picture of the designerPicture of the designer

 

Running of the programRunning of the program

 

Honestly, I didn't understand your point about item being decided on runtime. Do you mean you want to change the items of the list while the application is running?

Mohammad MORADI
ST Software Developer | TouchGFX

Thank you 

You're very welcome,
Good luck

Mohammad MORADI
ST Software Developer | TouchGFX