on 06-01-2005 7:58 AM
Hi Guys,
The requirement is something like this.
I have an ALV Grid where one of the columns is a checkbox. In my program, I'm making only a few of these checkboxes editable (using LVC_T_STYL). All the other columns are non-editable.
Now, I want an event to be triggered as soon as a user checks or unchecks the checkbox. Since I cannot assign a function code to this checkbox like in the case of a table-control, I have made this checkbox column a Hotspot.
The problem is that the hotspot appears even for those checkboxes which are disabled for input. The reason is that the HOTSPOT is a feature specified in the Field-Catalog and is supposed to be applicable for the entire column.
Is there a way that I can make the hotspot appear only when the checkbox is editable?
Or can you think of some other equally elegant (if not better) way of handling this scenario?
Regards,
Anand Mandalika.
P.S. I would also be glad to know how the fields STYLE2, STYLE3 and STYLE4 of the LVC_S_STYL are used.
Hi Anand
You haven't been here for long. We feel your absence but you seem busy.
Anyways, I guess you have tried registering the event with
CALL METHOD gr_alvgrid->register_edit_event
EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified.
Does it still require to change the field to realize the change even for a checkbox? I remember, like Raja, that they've implemented so that checkbox fields do not require this.
However, if so, would you like to try putting buttons instead of checkboxes. This way the event is immediately triggered and you can do what you want (and if required set the checkbox) there.
And, I guess nobody has any idea on STYLE2 and others...
Regards
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot Raja and Serdar.
The solution worked perfectly!! And it is definitely much much more elegant than a hotspot.
I was under the impression that the <b>data_changed</b> event would get triggerred only after the user hits enter or tabs to another field. Obviously, this is not the case with a checkbox.
Perhaps I was a bit too lazy to think about this further and try it out: -).
And Serdar: thanks for your kind words. Yes, I have been away on a short vacation for 10 days. And after I came back I have been a bit busy with my work. But I hope I can make my presence felt in a few days' time :-).
Thanks a lot once again.
Regards,
Anand Mandalika.
P.S. After answering to queries for so long on this forum (not to mention pestering the guys who don't give points for the right answers ), I feel like asking an occassional question. So the next time I find myself too busy (or too lazy??), I shall post a question (which I hope doesn't sound too stupid) and get the chance to reward a few points to the Gurus of ABAP out here. Cheers!!
Raja, Henry, Serder, others,
I have a real concern with this approach (people actively moderating the forums - rewarding people points).
Check out my comments in the following (right at the end). Please post your comments here as well.
I think this should be debated some more before it is allowed to continue.
Brad
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.