Double clicking matrix or grid cell
Hi there,
I Wanted to know if there's some way for my addon to know that a matrix or grid cell has been double clicked.
Thanks in advance
Hi,
There are two events 'et_DOUBLE_CLICK' and 'et_CLICK ' in Item event's pval.
HTH
B Ravi Shankar
Similar Messages
-
Hi,
I have this doubt regarding ALV grid display.
I am displaying a list using REUSE_ALV_GRID_DISPLAY.
I need to go to a transaction when i double click on a particular line on the output list based on the content of the 1st cell of that line. (ie if i have 4 columns and 5 records and click on the 3rd column of 2nd record then i need to know the value of the 1st field of the 2nd record)
I am using a call back user command subroutine to capture the index and the field which has been clicked upon. This index is giving perfect result by which I am reading the output table and doing the later operations.
But what if i sort the list in ALV by any column? Then the index that I will get on double clicking will correspond to the index on the screen but not to the index on my internal output table. In that case I will get a wrong value of the 1st field.
I do not want to use OO alv. Is there a way to handle this situation?
Regards,
ShinjanHello Shinjan,
When i display an output table say t_out on ALV GRID, the records in the table shown on the grid is identical to what i have in t_out. Hence the tabindex will correspond to that very record in t_out.
But when i sort the table on the grid, the order of the rows changes... so for example a row which had index 2 will now have an index 6 (say). So on clicking this record, the tabindex will be 6 where as the same record exist in 2nd position in t_out. How to handle this?
{quote]
Did you try this scenario? Your output table t_out also gets refarranged after SORT. Good thing is you DONOT have to code anything for this )
As per your example the table t_out will be rearranged so that the initial 2nd record will be at 6th posn.
FORM f_user_command USING fp_v_ucomm TYPE syucomm
fp_selfield TYPE slis_selfield."#EC CALLED
CONSTANTS:
l_c_ic1 TYPE char4 VALUE '&IC1',
l_c_vl TYPE char2 VALUE 'VL',
l_c_vl03n TYPE char5 VALUE 'VL03N'.
CASE fp_v_ucomm.
* Ok code for double code
WHEN l_c_ic1.
IF fp_selfield-tabindex NE space.
READ TABLE it_final INTO wa_final "it_final gets rearranged as per the SORT condition
INDEX fp_selfield-tabindex. "tabindex keeps the correct index after SORT
SET PARAMETER ID l_c_vl FIELD wa_final-vbeln.
CALL TRANSACTION l_c_vl03n AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM. "f_user_command
Please check & let us know.
BR,
Suhas
Edited by: Suhas Saha on Jan 2, 2009 11:48 AM
Edited by: Suhas Saha on Jan 2, 2009 11:53 AM -
Double-click in ALV Grid on BDC recording not recorded
Hi,
I'm recording a BDC session in a CRM system to enter a business partner. One of the steps is to choose a marketing attribute. To do this you have to double click on a (read only) ALV grid to select the attribute.
When I record this in SHDB or LSMW, the double click is never recorded?
Anybody else had problems recording a double click in an ALV grid.
Thanks
NaidooUnfortunely, BDC and gui controls do not get along. The ALV_Grid uses a gui control to intereactive with the user. Doing a recording over these kinds of transaction is not suggested for this very reason. You will have to find another way to achieve your result. Is there any BAPI or function module which does this functionality?
Regards,
Rich Heilman -
Double click in alv grid not refreshing until I click elsewhere
Hello,
I'm very new to abap and just managed to partly implement double click in an alv grid.
I also created a button that calls the exact same function as double click (selects the row and fills in the data areas on the page). When I use the button, everything works fine, but when I double click, nothing changes until I click on a tab or other form of input button on the page.
I have followed the process in debugging and can't find the fault anywhere.
My double click is implemented by:
create object lcl_event_receiver.
set handler lcl_event_receiver->double_click
for search_alv_grid.
endif.
CLASS lcl_event_handler DEFINITION.
public section.
methods:
double_click for event double_click
of cl_gui_alv_grid.
ENDCLASS. "lcl_event_handler
CLASS lcl_event_handler IMPLEMENTATION.
* METHOD double_click *
method double_click.
perform select_search_result.
endmethod. "double_click
ENDCLASS.
Any help would be much appreciatedHello,
Try using the template code given below. Let me know if you have any questions.
data : GT_EVENTS TYPE SLIS_T_EVENT.
get event
PERFORM BUILD_EVENT_TOPOFPAGE USING GT_EVENTS[].
display alv data
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_xxxxx
IT_FIELDCAT = GT_xxxx
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = T_xxxx
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
get event perform
FORM BUILD_EVENT_TOPOFPAGE USING LT_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
Read double click event using the below statement
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
INTO LS_EVENT.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " BUILD_EVENT_TOPOFPAGE
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
LS_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN <double click>
Perform do_something.
ENDCASE.
ENDFORM. " USER_COMMAND
Best Regards,
Krishna -
Hi,
I have 3 grids , like the following code.
SET HANDLER gr_event_handler->handle_double_click FOR o_grid. "GT_SUM_COPA.
SET HANDLER gr_event_handler->handle_double_click FOR o_grid2.
SET HANDLER gr_event_handler->handle_double_click FOR o_grid_final.
This is the implementation
CLASS lcl_event_handler IMPLEMENTATION .
*Handle Double Click
METHOD handle_double_click .
PERFORM handle_double_click USING e_row
e_column
es_row_no
sender.
ENDMETHOD.
ENDCLASS.
but how i can use the double click event using sender?
right now it is like the following.
FORM handle_double_click USING
i_row TYPE lvc_s_row
i_column TYPE lvc_s_col
is_row_no TYPE lvc_s_roid
sender TYPE lvc_s_sender.
READ TABLE GT_sum_COPA INDEX I_ROW-INDEX.
IF sy-subrc = 0.
CALL SCREEN 9100 .
ENDIF .
READ TABLE GT_FI INDEX I_ROW-INDEX.
IF sy-subrc = 0.
CALL SCREEN 9100 .
ENDIF .
READ TABLE GT_FINAL_COPA INDEX I_ROW-INDEX.
IF sy-subrc = 0.
CALL TRANSACTION 'KE24'.
ENDIF .
ENDFORM .
please suggest.Sender is a "formal parameter" an OBJECT reference like the object you used to create your Grid in CREATE OBJECT (TYPE REF TO class). It is the object which triggers the event - it is automatically defined as soon as it is defined as parameter. Look at [IMPORTING p1 p2 ... sender|http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm#!ABAP_ADDITION_1@1@] in [METHODS - FOR EVENT |http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm]
Your code should look like
FORM handle_double_click USING
i_row TYPE lvc_s_row
i_column TYPE lvc_s_col
is_row_no TYPE lvc_s_roid
sender.
CASE sender.
WHEN o_grid.
READ TABLE gt_sum_copa INDEX i_row-index.
IF sy-subrc = 0.
CALL SCREEN 9100 .
ENDIF .
WHEN o_grid2.
READ TABLE gt_fi INDEX i_row-index.
IF sy-subrc = 0.
CALL SCREEN 9100 .
ENDIF .
WHEN o_grid_final.
READ TABLE gt_final_copa INDEX i_row-index.
IF sy-subrc = 0.
CALL TRANSACTION 'KE24'.
ENDIF .
ENDCASE.
ENDFORM.
Regards,
Raymond
PS: Please, close the thread Problem with oops -
Double-click in ALV grid should take to BSP application
Hi,
In the portals, in an application, R/3 ALV grid is displayed. On double clicking one of the entries in the list, corresponding transaction in R/3 is opened and the details are displayed. Now, instead of opening the transaction in R/3, Corresponding PCUI application has to be opened. Is it possible to do it Portals? Can you please tell me how this can be acheived?
Thanks & Regards
G.Raja
P.S:- I'm not sure whether this topic can be discussed in this forum. Since the functionality is required in Portals, I'm putting it here.Hello G.Raja,
I think we should connect the Topics:
<a href="https://forums.sdn.sap.com/thread.jspa?threadID=70688">Calling PCUI application on clicking ALV grid in portals</a> by a link.
Regards
Gregor -
Overriding double click in JTable custom cell
I have a JTable where I reset the custom cells to become editable on a single click instead if a double using:
((DefaultCellEditor)table.getDefaultEditor(String.class)).setClickCountToStart(1);
Now what I need to do is display a JPopupMenu click a cell is double clicked. This works on cells that are not editable but the problem is that the user needs the popup dialog to display info for the cells that are editable.
I have used the basic way to implement a double click on a certain column (in this case my third column):
public void mouseClicked(MouseEvent e){
if (e.getClickCount() == 2 && table.getSelectedColumn() == 2 ){
popupMenu.show( e.getComponent(),
e.getX(), e.getY() );
But when double clicking, nothing happens.
Anyone have any idea to implement this or over-ride an editable cell?
Thanks,
ChrisThis still says <identifier> expect, how can I resove this please? Then you still have something wrong with your code. Since you didn't post your code how are we supposed to help?
The proper way to ask a question is to include your demo code that trys to illustrate the problem. Something like the following:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TableRightClick extends JFrame
public TableRightClick()
JTable table = new JTable(10, 5);
table.addMouseListener( new MouseAdapter()
public void mousePressed(MouseEvent e)
if ( SwingUtilities.isRightMouseButton(e) )
// if (e.isPopupTrigger())
JTable source = (JTable)e.getSource();
int row = source.rowAtPoint( e.getPoint() );
int column = source.columnAtPoint( e.getPoint() );
System.out.println(column);
source.changeSelection(row, column, false, false);
table.setPreferredScrollableViewportSize(table.getPreferredSize());
getContentPane().add( new JScrollPane(table) );
public static void main(String[] args)
TableRightClick frame = new TableRightClick();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setLocationRelativeTo( null );
frame.setVisible( true );
} -
Previous entered value is lost when double click in the Jtable cell.
Hi,
When I double click the cell in the Jtable, the pervious enter data is lost. I unable to mask the double click event also. Could you please help me out.
Thanks in Advance,
With Thanks and Regards,
ShivaWhen I double click the cell in the Jtable, the pervious enter data is lost.No it isn't unless you've customized the code and made an error.
If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area. -
How? double click to edit a cell in a JTable (Custom Editor/TableModel)
I have a JTable with a custom table model that when you click anything in the first column a custom editor appears. I would like to know how to make the custom editor appear after a double click on any cell in the first column. It can probably be done with a MouseListener but is there any easier way to do this?
Thanks.this works for me.
public class MyJcustomEditor extends DefaultCellEditor {
public MyJcustomEditor(JTextField tField) {
super(tField);
setClickCountToStart(2);
} -
Mouse Double Click on an editable cell of JTable
Hi Pros:
Maybe this is an old question but no answser from Forum.
I have a JTable with adding MouseListener. I tried to put double click behavior on nay row in the table. The problem was that this action can obly work on the uneditable cell and do not work on editable cell.
Anyone have ideas and help me.
Thank you!Hi Wang,
I have a problem similar to the one you have some time back.
I have a query for which I need to use PreparedStatement .The query runs likes this :-
String str = " Select ? , ename from emp where deptno ? ";
The values of ? need to be assigned dynamically.
But I cannot create Prepared Statement from this query .
If you have got answer to your questions can you inform me at
[email protected]
Thanks in advance -
Double click does not edit cell
One of my users: double-clicking a cell is expected to place the focus into the cell for editing, but the expected behavior isn't happening. Cursor remains unchanged.
It's not the mouse; I tried a couple. It's not plist, deleted both.
It is something totally simple but what?Complementary questions :
(1) How is the app behaving if you run it in an other user account ?
(2) Was Mac Os updated to 10.6.2 thru "Applications Update" ?
If it was, it may be a good idea to apply the combo updater available from:
http://support.apple.com/kb/dl959
Yvan KOENIG (VALLAURIS, France) mercredi 24 mars 2010 16:17:34 -
How to handle double click on alv grid
When I want to double click on a row of the alv grid, I want to give a message or redirecting the user to the row details screen..
I wait for your helps.
Thanks alot.Hello,
Check this report:
FORM ALV_DISPLAY.
*--- ALV List Display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_PROGNAME
I_CALLBACK_USER_COMMAND = G_CALLBACK_USER_COMMAND
IT_FIELDCAT = G_T_FIELDCAT
* IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = G_T_OUTTAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form F_USER_COMMAND_ALV
* text
* --> p1 text
* <-- p2 text
FORM F_ALV_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
*--- Hotspot selektion
CASE RS_SELFIELD-FIELDNAME.
WHEN 'POSID'.
*------ PSP-Element
*-------- Click auf PSP Element -> PSP Element anzeigen (CJ12)
SET PARAMETER ID 'PSP' FIELD SPACE.
SET PARAMETER ID 'PRO' FIELD RS_SELFIELD-VALUE.
CALL TRANSACTION 'CJ12' AND SKIP FIRST SCREEN.
WHEN 'STTXT_INT'.
*------ Systemstatus
G_STTXT_INT = RS_SELFIELD-VALUE.
*-------- G_T_LEGENDE erfüllen
PERFORM F_FILL_G_T_LEGENDE_INT.
G_R_LAYOUT-WINDOW_TITLEBAR = 'Systemstatus'(004).
PERFORM F_STATUS_LEGENDE_POPUP.
WHEN 'STTXT_EXT'.
*------ Anwenderstatus
G_STTXT_EXT = RS_SELFIELD-VALUE.
*-------- G_T_LEGENDE erfüllen
PERFORM F_FILL_G_T_LEGENDE_EXT.
G_R_LAYOUT-WINDOW_TITLEBAR = 'Anwenderstatus'(005).
PERFORM F_STATUS_LEGENDE_POPUP.
ENDCASE.
ENDCASE.
ENDFORM. "F_USER_COMMAND_ALV
IF useful reward.
Vasanth -
Command to handle the double click on a Grid Control
Hello,
In my application, I am adding multiple 'Grid' controls inside the 'Canvas' control. Each of this 'Grid' control is binded to a ViewModel object (say 'GridInformationViewModel') which is having a command saying 'ShowPropertiesWindow' to show a new window
for respective Grid control. Grids are dynamically getting added in the Canvas control for each the new ViewModel 'GridInformationViewModel'.
How i can bind this command for each of the 'Grid'?
Thanks,
IamHuMThanks all for your replies.
I tried adding code as per your suggestion. But i am not able to get the command working using the 'Interaction.Triggers'. Here is the code which i am using. Binding is working properly for this code only the command is not getting fired for the Grid control
'SelectedGrid'. Can you please help me to find the problem in my code.
<UserControl x:Class="CustomShapesDesigner.Controls.UserControlCustomShapePanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
d:DesignHeight="300" d:DesignWidth="300">
<Border BorderBrush="Purple" BorderThickness="5" >
<Grid Name="gridParentItems" Loaded="grid1_Loaded" >
<ScrollViewer Name="ScrollViewer"
Background="Black" HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" Loaded="DesignerScrollViewer_Loaded" >
<ItemsControl ItemsSource="{Binding CustomShapeItems}"
ItemContainerStyleSelector="{x:Static designerHelpers:DesignerItemsControlItemStyleSelector.Instance}">
<ItemsControl.Resources>
<Style x:Key="customShapeItemStyle" TargetType="{x:Type ContentPresenter}">
<Setter Property="Width" Value="200"/>
<Setter Property="Height" Value="200" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid x:Name="selectedGrid" Loaded="selectedGrid_Loaded"
MouseLeftButtonDown="selectedGrid_MouseLeftButtonDown" MouseLeftButtonUp="selectedGrid_MouseLeftButtonUp" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown" >
<i:InvokeCommandAction Command="{Binding ShowElementPropertiesCommand1}" CommandParameter="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ContentPresenter x:Name="PART_ContentPresenter"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Content="{TemplateBinding Content}" />
<Border BorderThickness="3" Margin="5" CornerRadius="3" BorderBrush="Aqua">
<Grid Margin="10" x:Name="PART_ConnectorDecorator"
MouseLeftButtonDown="selectedGrid_MouseLeftButtonDown" MouseLeftButtonUp="selectedGrid_MouseLeftButtonUp" >
</Grid>
</Border>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ItemsControl.Resources>
</ItemsControl>
</ScrollViewer>
</Grid>
</Border>
</UserControl>
Thanks,
IamHuM -
How do I execute Double click event in grid and list disaplay?
Hi
Kindly check the following threads:
Re: Double click event of alv grid control
double click on alv grid
Re: Using double click event in ALV Grid
you can find some code samples from the above links.
Hope this helps!
best regards,
Thangesh -
Adding the ABAP code to SAP Query to support Query's ALV Double click.
Hi, Expert.
I need to add some ABAP Code into SAP Query (or Infoset) to support the double click event on ALV cell of result of query.
Is it possible & How to do ?
Thank you very much.
Best Regard
Nattapash C.Hi, Gautham.
I've put BREAK-POINT in all code section e.g. INITIALIZATION, END-OF-SELECTION..
I found there are some section for add code that will be executed when query is processing before output data to ALV.
What I need to know is Where I can input the code after ALV output. For support the Double Click Event on Query's ALV cell.
Best Regard,
Nattapash C.
Maybe you are looking for
-
Cisco VPN Client and Windows XP Home
Hello, I cannot find any information to tell me whether Windows XP Home (Not XP Professional) is supported under ant Cisco VPN client 4.xx or 5.xx. We have several "home" users and when trying to install it just causes the pc to do a looping reboot.
-
Hi all Can you please help me with some information on <b>standard errors list</b> that occur in MAM, checked with the error handling of MAM 2.5 it only had 1error scenario regards sam
-
Will Apple be coming out with a duo dock that will fit both the 3G iPhone and the Apple BT headset. I thought it was one of the best features of the original Apple iPhone/BT headset combination. Thanks for your help.
-
Freezing since the first ipad sync
Since my first ipad sync, my macbook pro has started freezing for the first time ever! The ipad is not connected or syncing during these episodes. Happens when I am logged on an internet site. Force quit does not even work. Has happened five times si
-
Dual SG 300-10 mounting and cascading
SG 300-10 user manual states to not mount the switch on either side (I'm assuming this means the right or left ends as you face the front) and that they can be mounted either face-up or face down or flat). The specs further say that a 5" space must b