on 10-14-2008 2:25 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.