2023-04-18 01:22 AM
2023-04-18 10:15 AM
Hello
Perhaps you could use Custom triggers to generate callback first from custom container to parent container and then another custom trigger to generate callback from parent container to view- class.
In this example use of custom triggers is demostrated (from sub container to parent container):
https://community.st.com/s/contentdocument/0693W00000aHeqeQAC
2023-04-18 10:07 PM - edited 2023-11-20 07:52 AM
Thanks for reply. In that example it does not clear how TOUCHGFX generates callbacks:
2023-04-18 10:11 PM - edited 2023-11-20 07:52 AM
Okay, I found that here is created custom trigger:
But how that text is passed to other container does not find
2023-04-19 08:42 AM - edited 2023-11-20 07:52 AM
You could use trigger system to send notification to the wiew- class, that text can be retrieved and then use simply functions from view class to container and finally to sub container. Check the example, in keypad.cpp there is char* Keypad::getText() function and in the KeypadCustomWidgetExample.cpp file is call for that.
Otherway is to create Trigger and set type char * or const char * (depending what you are sending)
Please also note that you can use TGFX Designer Interactions to create handler for these trigger callbacks and then call some virtual function in the container:
And then define the virtual function and handle the text or trigger another callback to send it to the wiew- class.
But to be honest... sending strings thru the containers sounds bit weird I wonder what you are trying achieve with this.
2023-04-19
09:00 AM
- last edited on
2023-12-06
04:58 AM
by
Laurids_PETERSE
I need pass just a variable from container to view. In custom container I have button and I need to pass how many times button was pressed. Problem is this that I create in view screen list layout and in that list putting custom container
Custom container:
And in this container u can see plus button which I need to know how many times it was pressed because I need to know that value to create other list element.. I do not know are u understand :D Maybe u have other solution?
2023-04-19 10:00 AM
Not completely understand, it is difficult when not see the hole picture how you have organize the things in UI.
But you could send trigger callback everytime when plus is pressed, or simply keep the count of presses in the container local variable and then read the counter value from parent class with simple function when adding things is finished ?
2023-04-19
11:34 AM
- last edited on
2023-12-06
05:00 AM
by
Laurids_PETERSE
It's difficult to explain :D amm, that container is not included in my view window and I can't access it. If I add custom container in my view it would be easy but now I've created list layout and in that list is custom container .
Like this:
I can send more code if it helps to understand what I want :D
2023-05-08 03:10 AM
Hello heyo,
Did you find a solution to your problem? If not, I was thinking maybe you can store your value from your container in the model and then get that value in your view screen.
/Osman