564 views
in GUI Development by

Hi everyone,

I have some parameters and I want to delegate it's values within the vertical list. I am doing like this,
 

for(i=0;i<VerticalList.NoOfItems;i=i+1)
{
  native(val,i)
  {
     val = parameters[i].actualVal;
  }
  
  ((Application::StatusInfoItem)VerticalList.GetViewForItem( i )).Value = string(val);
  
}

But, there is an error when I am trying to set the Values of non-visible verticallist items. How can i do that? Or Is there a way to understand which items are visible?

Thanks in advance

1 Answer

0 votes
by

Hello,

the problem of the code snippet is, that you access the result of GetViewForItem() without checking it. This method only works for items which are currently in the memory - for all other items the method returns null.

It is important to understand that the Verical List is used to present data in a list - but it is not the container to maintain or modify the data. For that purpose, let me refer to the chapter Access list items and views of the Vertical List.

The recommended way is to use OnLoadItem() in order to configure the currently loaded items of the list.

I hope this helps...

Best regards,

Manfred

 

by

I am already configuring the items in OnLoadItem() method

var int32       itemNo   = VerticalList.Item;
var Application::StatusInfoItem itemView = (Application::StatusInfoItem)VerticalList.View;

// The implementation of this slot method does not match the item class
// specified in the associated list component. Or the slot method is not
// called in context of the OnLoadItem list operation. 
if ( itemView == null )
  return;

// Configure the item view ...
itemView.Title = this.EnglishList[itemNo];
itemView.Value = "0";

// Ensure that the item has correct size. The position of the item will be
// managed by the list component.
itemView.Bounds.size = point( VerticalList.Bounds.w, VerticalList.ItemHeight );

How can i check the item is currently in visible area ?

by

If you want to refresh the list items (e.g. because there are new data available) you can call InvalidateItems(). As a result, the list will automatically reload the currently visible items by calling OnLoadItem. This means, there is only one location where the list items are configured.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...