cancel
Showing results for 
Search instead for 
Did you mean: 

table view:number of entries

Former Member
0 Kudos

Hi,

I need to disable a button when I have added a single entry to my table view.

How do i check for the number of entries in a table view in order to disable the button of adding further entries.

Thanks and Regards

Shilpi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shilpi,

In the implementation class of the view, there will be a method called DO_PREPARE_OUTPUT. This method will be called during every round trip. In this method, call the method COUNT of the collection of the table view. Sample code : ME->TYPED_CONTEXT->[CONTEXT NODE NAME]->COLLECTION_WRAPPER->COUNT.

This returns the number of records in that collection.

Thanks,

Vinay

CarstenKasper
Active Contributor
0 Kudos

Hi,

I have not used the COUNT variable on the collection wrapper, but there is a method SIZE( ) on it as well that will tell how many entries there are. It does not matter if it is a value or model node.


if typed_context->/MyContextNode/->collection_wrapper->size( ) < 1.
*enable button
endif.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Could u plz describe more for which view and component u want to do this.

In general ITERATOR control all activities for table view.U can find all table view iterator method's in ur IMPL class . Interface for ITERATOR is IF_HTMLB_TABLEVIEW_ITERATOR.

Regards

Gaurav

former_member813607
Contributor
0 Kudos

Hi Shilpi,

From where the data s flowing to your table view from internal table or context node ?

If it is from a context node ( collection ) then you have to follow the method as suggested by nugur..

else, if it is a custom view and you are manually inserting values to the tables..

you can read the row / values via iterator, which contains the methods to manipulate the rows and its values.

Regards, Sudeep..