on 05-17-2011 9:42 AM
Hello Experts,
I have the following requirement for an Assignment Block :
-------------------------------------
A AA
B BB
C CC
D DD
E EE
-----------------------------------
T1 T2
-----------------------------------
Here the last rows indicate sum of the column values and it need to be read-only field but it should be sets with the column sum.
Any suggestions as to how to achieve this requirement?
Regards
Nisha
Hi Nisha,
Depending on whether tablview is model/value node and when should the sum be calculated - you can write in do_init_context or do_prepare_output or on event handler of some button (if it's on button click).
Looping on the collection wrapper - create one more entity when you reach last row of collection - keep adding sum to a variable, create new entity in last, set attribute of the entity column with the sum and add it to collection.
Also, to make only last row editable - you can either implement iterator and write code to enable/disable in IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS method of iterator class or write code in GET_I method to make the field disabled if the column name of tableview is 'SUM' or whatever name has been fixed for it.
Thanks,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try to set a debug point in get_i method of the attribute.
The sum should be calculated when you do an action. On action you can set a value of a global parameter and read that parameter in get_i method and return the value as false.
Regards
Sohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
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.