how to size customList in view using model const
Hi there Touchgfx team!
I have a view with a custom container list as in the ListLayout example.
class test_selectionView : public test_selectionViewBase
{
public:
test_selectionView();
virtual ~test_selectionView() {}
virtual void setupScreen();
virtual void tearDownScreen();
/**
* Handler of list element clicks.
*/
void listElementClicked(CustomListElement &element);
protected:
static const int number_of_select_test_kit_list_elements = 30;
CustomListElement select_test_kit_list_elements[number_of_select_test_kit_list_elements];
// Callback that is assigned to each list element
Callback<test_selectionView, CustomListElement &> listElementClickedCallback;
};
I would like to have the number of elements in the model, and access it with a get method. Right now, you can see I'm harcoding the "30" value in the view.
I already created number_of_select_test_kit_list_elements in the model and created the get method, because that number will be used across several screens.
How can I create the CustomListElement using the get method from the model?
Thanks a lot in advance
