How to handle double click on af:table ?
..... I use JDev 11g .......
I have an af:table I want when I double click on row in this table I execute a method in backing bean.
( I know there is a selectionListener in table but this for single click I want a method call only if I double click on the table )
How can I do that?
Thank You...
Sameh Nassar
You may use this method.
1. Register a client listener on the table:
<af:clientListener type="dblClick" method="doDbClick"/>
The method doDbClick is a javascript function:
<trh:script>function doDbClick(event) {
var source = event.getSource();
AdfCustomEvent.queue(source,"doDbClick", {}, false);
</trh:script>
2. Register a server listener on the table to consume this custom event:
<af:serverListener type="doDbClick" method="#{backingBeanScope.txnBean4.doDbClick}"/>
The java method:
public void doDbClick(ClientEvent event){
// do whatever u want
Colin
Similar Messages
-
How to handle double click in a table control?
Hi,
Can any one let me how to handle double click event in a table control in dialog programming?
here i need to navigate to another screen when user double click on the table contols (emp number column).
thanks in advance,
PrasadBabu.to define double click in your table controlwhich is similar to 'PICK' function. Enable F2 in PF-status for this
Table Control Question
Check the above thread which was posted recently on SDN, please award points if found helpful -
How to handle double click event in a text control
Hi,
Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.
Regards,
Praba.Hi Prabhavathi,
Here is how you handle double click events in Textedit control.
1)Create a custom control in screen (say TEXT_CONTROL)
2)In main program,
a) Declarations:
data: obj type ref to cl_gui_custiom_control.
text type ref to cl_gui_textedit.
b) Create the instance of custom container
c) Create the instance of textedit control.
3)Now to handle double click events , create a local class as follows.
class shail_event definition.
public section.
methods:
handle_doubleclick for event dblclick of cl_gui_textedit .
endclass.
class shail_event implementation.
method handle_doubleclick .
here do the coding for handling the double click.
endmethod.
endclass.
4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
5) Define varibles for event.
DATA: i_events TYPE cntl_simple_events,
wa_events TYPE cntl_simple_event.
SET HANDLER hand->handle_doubleclick for text.
wa_events-eventid = cl_gui_textedit=>event_double_click.
wa_events-appl_event = 'X'. "This is an application event
APPEND wa_events TO i_events.
6)
CALL METHOD texte->set_registered_events
EXPORTING
events = i_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
If you want the program, kindly send your mail-id so that I can mail it to you.
Regards,
Sylendra. -
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 -
How to handle double clicking on alv?
Hi experts,
I have an ALV list. I'm using the code below, but however I click on a hotspot field in alv it doesn't run to the break-point in FORM user_command. How could it be?
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_user_command = 'USER_COMMAND'
FORM user_command USING ucomm selfield TYPE slis_selfield..
CASE ucomm.
WHEN '&IC1'.
break-point.
ENDCASE.
ENDFORM.hi,
check this.
*& Report ZINT_ALV
REPORT zint_alv.
TYPE-POOLS:slis.
TABLES:mara,
makt,
mseg.
DATA:BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
maktx LIKE makt-maktx,
END OF itab.
DATA:BEGIN OF itab1 OCCURS 0,
mblnr LIKE mseg-mblnr,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
werks LIKE mseg-werks,
END OF itab1.
DATA:fcat TYPE slis_t_fieldcat_alv,
fcat1 TYPE slis_t_fieldcat_alv,
eve TYPE slis_t_event,
eve1 TYPE slis_t_event.
DATA:t_mat LIKE mara-matnr.
SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:mat FOR mara-matnr.
SELECTION-SCREEN:END OF BLOCK blk1.
INITIALIZATION.
PERFORM build_fcat USING fcat.
PERFORM build_eve.
START-OF-SELECTION.
PERFORM get_data.
PERFORM dis_data.
*& Form build_fcat
text
-->T_FCAT text
FORM build_fcat USING t_fcat TYPE slis_t_fieldcat_alv.
DATA:wa_fcat TYPE slis_fieldcat_alv.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-seltext_m = 'Material'.
wa_fcat-hotspot = 'X'.
APPEND wa_fcat TO t_fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MAKTX'.
wa_fcat-seltext_m = 'Description'.
APPEND wa_fcat TO t_fcat.
CLEAR wa_fcat.
ENDFORM. "build_fcat
*& Form build_eve
text
FORM build_eve.
DATA:t_eve TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = eve
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE eve INTO t_eve WITH KEY name = 'USER_COMMAND'.
IF sy-subrc = 0.
t_eve-form = 'USER_COMMAND'.
MODIFY eve FROM t_eve TRANSPORTING form WHERE name = t_eve-name.
ENDIF.
ENDFORM. "build_eve
*& Form get_data
text
FORM get_data.
SELECT maramatnr maktmaktx INTO CORRESPONDING FIELDS OF TABLE itab
FROM mara INNER JOIN makt
ON maramatnr = maktmatnr
WHERE mara~matnr IN mat.
ENDFORM. "get_data
*& Form dis_data
text
FORM dis_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZINT_ALV'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = 'Interactive ALV'
it_fieldcat = fcat
it_events = eve
TABLES
t_outtab = itab
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. "dis_data
*& Form user_command
text
-->U_COM text
FORM user_command USING u_com LIKE sy-ucomm sel_field TYPE slis_selfield.
CLEAR fcat1.
CASE u_com.
WHEN '&IC1'.
READ TABLE itab INDEX sel_field-tabindex.
IF sel_field-fieldname = 'MATNR'.
IF sy-subrc = 0.
t_mat = itab-matnr.
PERFORM build_cat1 USING fcat1.
PERFORM build_eve1.
PERFORM get_data1.
PERFORM dis_data1.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "user_command
*& Form build_fcat1
text
-->T_FCAT1 text
FORM build_cat1 USING t_fcat1 TYPE slis_t_fieldcat_alv.
DATA:wa_fcat1 TYPE slis_fieldcat_alv.
wa_fcat1-tabname = 'ITAB1'.
wa_fcat1-fieldname = 'MBLNR'.
wa_fcat1-seltext_m = 'Material Doc.'.
APPEND wa_fcat1 TO t_fcat1.
CLEAR wa_fcat1.
wa_fcat1-tabname = 'ITAB1'.
wa_fcat1-fieldname = 'MENGE'.
wa_fcat1-seltext_m = 'Quantity'.
APPEND wa_fcat1 TO t_fcat1.
CLEAR wa_fcat1.
wa_fcat1-tabname = 'ITAB1'.
wa_fcat1-fieldname = 'MEINS'.
wa_fcat1-seltext_m = 'UOM'.
APPEND wa_fcat1 TO t_fcat1.
CLEAR wa_fcat1.
wa_fcat1-tabname = 'ITAB1'.
wa_fcat1-fieldname = 'WERKS'.
wa_fcat1-seltext_m = 'Plant'.
APPEND wa_fcat1 TO t_fcat1.
CLEAR wa_fcat1.
ENDFORM. "build_fcat1
*& Form build_eve1
text
FORM build_eve1.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = eve1
EXCEPTIONS
list_type_wrong = 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. "build_eve1
*& Form get_data1
text
FORM get_data1.
SELECT mblnr menge meins werks FROM mseg
INTO CORRESPONDING FIELDS OF TABLE itab1
WHERE matnr = t_mat.
ENDFORM. "get_data1
*& Form dis_data1
text
FORM dis_data1.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZINT_ALV'
it_fieldcat = fcat1
it_events = eve1
TABLES
t_outtab = itab1
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. "dis_data1 -
Handling double-click in tabstrips.
Hi All,
I have a requirement in which there is a tabstrip with 4 tabs ( it is in second screen). Based on the number of tabs selected by the user in first screen, those many tabs will be active in second screen.
Here each tab indicates a different transaction code.
We have set the first tab selected by the user as the default tab in the second screen.When we double click on the data displayed in the subscreen area , it should navigate to the respective transaction code.
Currently, when we double click on the data in the default subscreen area, it does not navigate, but when we toggle between the tabs and then come back to the default tab screen then it navigates as expected.
Please let me how to handle double click functionality for the default tab set by the user without the need to toggle between the tabs.
Thanks in advance.Hi All,
I have a requirement in which there is a tabstrip with 4 tabs ( it is in second screen). Based on the number of tabs selected by the user in first screen, those many tabs will be active in second screen.
Here each tab indicates a different transaction code.
We have set the first tab selected by the user as the default tab in the second screen.When we double click on the data displayed in the subscreen area , it should navigate to the respective transaction code.
Currently, when we double click on the data in the default subscreen area, it does not navigate, but when we toggle between the tabs and then come back to the default tab screen then it navigates as expected.
Please let me how to handle double click functionality for the default tab set by the user without the need to toggle between the tabs.
Thanks in advance. -
Handle double click for alv_tree?
hej out there,
as you may remember I'm doing some updates to UIs.
Somehow it should be possible to make alv_tree handle double_click events, shouldn't it?
I don't know how to go on. I found some methods but they don't work properly (or as expected).
I know there are methods to do so with simple_tree... hmpf. But it would be the worst solution to switch technique to simple_tree.
regards and thanks in advance,
BSHej,
I gotta do it using alv-tree.
And I tried it the following way (just did a short and quick example which remains fundamentally the same to my old report).
But the way it's done in the following code snipped it won't work... if decomment
* event-eventid = cl_gui_alv_tree=>eventid_node_double_click .
* event-appl_event = ' ' .
* APPEND event TO events .
the message will be raised telling node double click has been handled... but not a single node can be expanded anymore.
CLASS event DEFINITION.
PUBLIC SECTION.
METHODS:
handle_node_dblclick
FOR EVENT node_double_click
OF cl_gui_alv_tree
IMPORTING node_key.
ENDCLASS.
CLASS event IMPLEMENTATION.
METHOD handle_node_dblclick.
DATA:
l_carrid TYPE spfli-carrid,
l_connid TYPE spfli-connid.
l_carrid = node_key(2).
l_connid = node_key+2(4).
MESSAGE i001(ZBOBOPP1) WITH 'handled double click'
l_carrid
l_connid .
ENDMETHOD.
ENDCLASS.
DATA:
ctrlcontainer TYPE REF TO cl_gui_docking_container ,
treectrl TYPE REF TO cl_gui_alv_tree ,
evt TYPE REF TO event ,
tblpointer TYPE TABLE OF scustom ,
fieldcat TYPE lvc_t_fcat ,
hierhead TYPE treev_hhdr ,
events TYPE cntl_simple_events ,
event TYPE cntl_simple_event .
MODULE status_0100 OUTPUT.
SET PF-STATUS 'S_100'.
SET TITLEBAR 'T_100'.
IF ctrlcontainer IS INITIAL .
CREATE OBJECT evt.
CREATE OBJECT ctrlcontainer
EXPORTING
extension = 900 .
CREATE OBJECT treectrl
EXPORTING
parent = ctrlcontainer
no_html_header = 'X' .
PERFORM adjcolarea
CHANGING fieldcat.
hierhead-heading = 'Land/Kundenname/Kunde'(300).
hierhead-tooltip = 'Name des Kunden'(400).
hierhead-width = 45.
hierhead-width_pix = space.
CALL METHOD treectrl->set_table_for_first_display
EXPORTING
is_hierarchy_header = hierhead
CHANGING
it_outtab = tblpointer
it_fieldcatalog = fieldcat.
* event-eventid = cl_gui_alv_tree=>eventid_node_double_click .
* event-appl_event = ' ' .
* APPEND event TO events .
* CALL METHOD treectrl->set_registered_events
* EXPORTING
* events = events .
SET HANDLER evt->handle_node_dblclick FOR treectrl .
PERFORM select_data_and_fill_col_tree .
CALL METHOD treectrl->frontend_update .
CALL METHOD cl_gui_cfw=>flush .
ENDIF .
ENDMODULE . " STATUS_0100 OUTPUT
Thanks,
BS
Message was edited by: Boris Schoessow -
Handling double click event in oops alv
I need to write a interactive alv where,can any one help me in handling double click event using oops.
Hello,
Demo program on interactive ALV using OOPS
REPORT ZALV_OOINTERACTIVE.*Class definition for handling double click
CLASS event_class DEFINITION DEFERRED.*Internal table and work area declarations for dd02l and dd03l
DATA : it_dd02l TYPE TABLE OF dd02l,
wa_dd02l TYPE dd02l,
it_dd03l TYPE TABLE OF dd03l,
wa_dd03l TYPE dd03l.*data declarations for ALV Main list
DATA : ty_lay1 TYPE lvc_s_layo,
it_fieldcat TYPE lvc_t_fcat ,
ty_fieldcat TYPE lvc_s_fcat ,
c_alv1 TYPE REF TO cl_gui_alv_grid,
c_cont1 TYPE REF TO cl_gui_custom_container,
event_receiver TYPE REF TO event_class.*data declarations for ALV Interactive listDATA : ty_lay2 TYPE lvc_s_layo,
it_fcat TYPE lvc_t_fcat ,
ty_fcat TYPE lvc_s_fcat ,
c_alv2 TYPE REF TO cl_gui_alv_grid,
c_cont2 TYPE REF TO cl_gui_custom_container.
**Select options for multiple values and NOT ranges
SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
Initialization event
INITIALIZATION.*Start of selection event
START-OF-SELECTION.*fetch data into table and field characteristics
PERFORM fetch_data.*ALV display for output
PERFORM alv_output.&----
*& Form FETCH_DATA
text
--> p1 text
<-- p2 text
FORM fetch_data .*Select the table details
SELECT * FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l
WHERE tabname IN s_table
AND tabclass = 'TRANSP'.
ENDFORM. " FETCH_DATA----* CLASS lcl_event_receiver DEFINITION----CLASS event_class DEFINITION.*Handling double click
PUBLIC SECTION. METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row .ENDCLASS. "lcl_event_receiver DEFINITION
----* CLASS lcl_event_receiver IMPLEMENTATION
----CLASS event_class IMPLEMENTATION. METHOD handle_double_click. DATA : ls_dd02l LIKE LINE OF it_dd02l.*Reading the selected data into a variable
READ TABLE it_dd02l INDEX e_row-index INTO ls_dd02l.* *Select the field details of the selected table
SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
WHERE tabname EQ ls_dd02l-tabname.
*calling the ALV containing the field values
CALL SCREEN 101. ENDMETHOD. "handle_double_clickENDCLASS. "lcl_event_receiver IMPLEMENTATION&----& Module pbo_100 OUTPUT&----
*MODULE pbo_100 OUTPUT.
*set pf-status 'XXX'.
*set titlebar 'XXX'.
ENDMODULE. " PBO_100 OUTPUT
*& Module alv_100 OUTPUT
&----MODULE alv_100 OUTPUT.*Check if there is no custom container in screen 100
IF c_cont1 IS INITIAL.*Creating object of container
CREATE OBJECT c_cont1
EXPORTING
container_name = 'CCONT'.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*Creating object of alv
CREATE OBJECT c_alv1
EXPORTING
i_parent = c_cont1.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*alv layout
PERFORM alv_100_layout.*alv field catalogue
PERFORM alv_100_fieldcat.*Displaying the ALV grid
CALL METHOD c_alv1->set_table_for_first_display
EXPORTING
is_layout = ty_lay1
CHANGING
it_outtab = it_dd02l[]
it_fieldcatalog = it_fieldcat. IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*Create object of the event class and setting handler for double click
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_double_click FOR c_alv1. ENDIF.ENDMODULE. " ALV_100 OUTPUT&----& Module pai_100 INPUT&----
*MODULE pai_100 INPUT.
ENDMODULE. " pai_100 INPUT----* MODULE PBO_101 OUTPUT----MODULE pbo_101 OUTPUT.
SET PF-STATUS 'XXX'.
SET TITLEBAR 'XXX'.
ENDMODULE. " PBO_101 INPUT----* MODULE ALV_101 OUTPUT----
MODULE alv_101 OUTPUT.
*Check if the Custom container exists.
IF c_cont2 IS INITIAL.*Creating container object
CREATE OBJECT c_cont2
EXPORTING
container_name = 'CDCONT'.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*creating ALV grid for interactive list
CREATE OBJECT c_alv2
EXPORTING
i_parent = c_cont2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*ALV layout
PERFORM alv_101_layout.*ALV fieldcatalogue
PERFORM alv_101_fieldcat.*Sorting the output by field position
SORT it_dd03l BY position.*ALV for display field details
CALL METHOD c_alv2->set_table_for_first_display
EXPORTING
is_layout = ty_lay2
CHANGING
it_outtab = it_dd03l[]
it_fieldcatalog = it_fcat.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. ENDIF.ENDMODULE. " ALV_101 OUTPUT
&----& Module PAI_101 INPUT&----
*MODULE pai_101 INPUT.ENDMODULE. " PAI_101 INPUT
*& Form ALV_OUTPUT
text
--> p1 text
<-- p2 text
FORM alv_output .
CALL SCREEN 100.ENDFORM. " ALV_OUTPUT
*& Form ALV_100_LAYOUT
text
--> p1 text
<-- p2 text
FORM alv_100_layout . ty_lay1-grid_title = 'TABLES'.
ty_lay1-zebra = 'X'.
ty_lay1-no_toolbar = 'X'.ENDFORM. " ALV_100_LAYOUT
*& Form ALV_100_FIELDCAT
text
--> p1 text
<-- p2 text
FORM alv_100_fieldcat .
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 1.
ty_fieldcat-fieldname = 'TABNAME'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'TableName'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat. ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 2.
ty_fieldcat-fieldname = 'TABCLASS'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'CATEGORY'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat. ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 3.
ty_fieldcat-fieldname = 'AS4USER'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'CREATED'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat. ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 4.
ty_fieldcat-fieldname = 'AS4DATE'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'DATE'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 5.
ty_fieldcat-fieldname = 'AS4TIME'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'TIME'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat. ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 6.
ty_fieldcat-fieldname = 'CONTFLAG'.
ty_fieldcat-tabname = 'GT_DD02L'.
ty_fieldcat-coltext = 'Delivery Class'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.ENDFORM. " ALV_100_FIELDCAT
*& Form ALV_101_LAYOUT
text
--> p1 text
<-- p2 text
FORM alv_101_layout . ty_lay2-grid_title = 'FIELDS'.
ty_lay2-zebra = 'X'.
ty_lay2-no_toolbar = 'X'.ENDFORM. " ALV_101_LAYOUT
*& Form ALV_101_FIELDCAT
text
--> p1 text
<-- p2 text
FORM alv_101_fieldcat . REFRESH it_fieldcat.
REFRESH it_fcat.
CLEAR ty_fcat. ty_fcat-row_pos = 1.
ty_fcat-col_pos = 1.
ty_fcat-fieldname = 'FIELDNAME'.
ty_fcat-tabname = 'GT_DD03L'.
ty_fcat-coltext = 'Fieldname'.
ty_fcat-outputlen = 10.
APPEND ty_fcat TO it_fcat.
ty_fcat-row_pos = 1.
ty_fcat-col_pos = 2.
ty_fcat-fieldname = 'CHECKTABLE'.
ty_fcat-tabname = 'GT_DD03L'.
ty_fcat-coltext = 'CHECKTABLE'.
ty_fcat-outputlen = 10.
APPEND ty_fcat TO it_fcat. ty_fcat-row_pos = 1.
ty_fcat-col_pos = 3.
ty_fcat-fieldname = 'KEYFLAG'.
ty_fcat-tabname = 'GT_DD03L'.
ty_fcat-coltext = 'Key Flag'.
ty_fcat-outputlen = 10.
APPEND ty_fcat TO it_fcat.ENDFORM. " ALV_101_FIELDCAT -
Problem in handling double click in the second alv grid control
Hi all,
I have a screen. In the screen , I have 2 custom container and each custom container has 1 alv grid control.
I need to handle double click event for both of alv grid controls in my screen.
I defined 2 local event handler class for each alv grid and defined 2 handle_double_click event.
In the first Alv grid double click works fine , everything is ok, world is peaceful.
But in the second alvgrid, the row parameters (E_ROW, E_COLUMN, ES_ROW_NO) comes initial so i cannot handle it.
All i need is to call a different transaction (displaying the equipment-IE03) when user double-click on a field in the second alv grid control. I tried to use hotspot_click event too but it does'nt give the row id either.
I read some posts in the forms ([Double click event of alv grid control|Double click event of alv grid control]).
I tried everything but nothing works.
Please help. Your answers will be appreciated.Hello Eagle
I am not sure where the problem lies in your case but sample report ZUS_SDN_THREE_ALV_GRIDS_01 shows that you can always find out the current cell after the double-click event (in any case you have the current cell already as IMPORTING parameters of the event):
*& Report ZUS_SDN_THREE_ALV_GRIDS_01
*& Flow logic of screen '0100' (no screen elements, ok-code => GD_OKCODE):
** PROCESS BEFORE OUTPUT.
** MODULE STATUS_0100.
** PROCESS AFTER INPUT.
** MODULE USER_COMMAND_0100.
*& Thread: problem in handling double click in the second alv grid control
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1172052"></a>
REPORT zus_sdn_three_alv_grids_01.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syst-repid,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_splitter_2 TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_cell_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
go_grid3 TYPE REF TO cl_gui_alv_grid.
DATA:
gt_outtab TYPE STANDARD TABLE OF vbak,
gt_outtab_2 TYPE STANDARD TABLE OF vbap,
gt_outtab_3 TYPE STANDARD TABLE OF vbep.
**PARAMETERS:
** p_bukrs TYPE bukrs DEFAULT '1000'.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
ms_row TYPE lvc_s_row,
ms_col TYPE lvc_s_col.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_outtab TYPE vbak,
ls_outtab_2 TYPE vbap,
ls_outtab_3 TYPE vbep.
" Initialize class data
CLEAR: ms_row,
ms_col.
CASE sender.
WHEN go_grid1.
ms_row = e_row.
ms_col = e_column.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'GET_ITEMS'
* IMPORTING
* rc =
WHEN go_grid2.
ms_row = e_row.
ms_col = e_column.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'GET_SCHEDULE_LINES'
* IMPORTING
* rc =
WHEN go_grid3.
** READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
** CHECK ( ls_vbap-matnr IS NOT INITIAL ).
** SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
** CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
WHEN OTHERS.
RETURN.
ENDCASE.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM vbak INTO TABLE gt_outtab UP TO 100 ROWS.
PERFORM init_controls.
* Display data
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAK'
CHANGING
it_outtab = gt_outtab
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_outtab_2.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAP'
CHANGING
it_outtab = gt_outtab_2 " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_outtab_3.
CALL METHOD go_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'VBEP'
CHANGING
it_outtab = gt_outtab_3 " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro:
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "ORDERS"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Refresh display of detail ALV list
CALL METHOD go_grid3->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
" Double-click on first or second ALV grid
WHEN 'GET_ITEMS' OR
'GET_SCHEDULE_LINES'.
PERFORM get_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 1
columns = 2
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_left.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
* Create 2nd splitter container
CREATE OBJECT go_splitter_2
EXPORTING
parent = go_cell_left
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter_2->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter_2->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT go_grid3
EXPORTING
i_parent = go_cell_right
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.
ENDFORM. " INIT_CONTROLS
*& Form GET_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM get_details .
* define local data
DATA: ls_row TYPE lvc_s_row,
ls_col TYPE lvc_s_col.
data: ls_outtab type vbak,
ls_outtab_2 type vbap,
ls_outtab_3 type vbep.
BREAK-POINT.
CASE gd_okcode.
WHEN 'GET_ITEMS'.
CALL METHOD go_grid1->get_current_cell
IMPORTING
* e_row =
* e_value =
* e_col =
es_row_id = ls_row
es_col_id = ls_col
* es_row_no =
read TABLE gt_outtab into ls_outtab index ls_row-index.
refresh: gt_outtab_2,
gt_outtab_3.
SELECT * FROM vbap into TABLE gt_outtab_2
WHERE vbeln = ls_outtab-vbeln.
WHEN 'GET_SCHEDULE_LINES'.
CALL METHOD go_grid2->get_current_cell
IMPORTING
* e_row =
* e_value =
* e_col =
es_row_id = ls_row
es_col_id = ls_col
* es_row_no =
READ TABLE gt_outtab_2 into ls_outtab_2 index ls_row-index.
refresh: gt_outtab_3.
SELECT * FROM vbep into TABLE gt_outtab_3
WHERE vbeln = ls_outtab_2-vbeln
AND posnr = ls_outtab_2-posnr.
WHEN OTHERS.
RETURN.
ENDCASE.
IF ( lcl_eventhandler=>ms_row = ls_row AND
lcl_eventhandler=>ms_col = ls_col ).
MESSAGE 'Current cell identical' TYPE 'I'.
ELSE.
MESSAGE 'Current cell NOT identical' TYPE 'I'.
ENDIF.
ENDFORM. " GET_DETAILS
Regards
Uwe -
Handling Double click on a Pop-up screen with ALV Grid
Hello Experts,
I have an issue handling double click on ALV Pop-up screen. I tried to achive this using following steps.
1. I defined a local class in Top-include to handle double click and implemented it in the following way.
CLASS lcl_alv_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
on_double_click FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no.
ENDCLASS. "lcl_alv_event_handler DEFINITION
*~~~ Implementation code
CLASS lcl_alv_event_handler IMPLEMENTATION.
To handle Selection of Issue data on Screen 100
METHOD on_double_click.
DATA: lt_row_no TYPE lvc_t_roid,
ls_req TYPE zcst_zirt_seltab.
READ TABLE gt_req
INTO ls_req
INDEX e_row-index.
g_req_id = ls_req-zzrequest_id.
gv_selected = true.
CALL METHOD go_alv->dispatch
EXPORTING
cargo = 'OK'
eventid = 3
is_shellevent = ' '
is_systemdispatch = 'X'
EXCEPTIONS
cntl_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.
ENDMETHOD. "on_double_click
ENDCLASS. "lcl_alv_event_handler IMPLEMENTATION
2. Registered the event in the PBO module of the screen
ls_events-eventid = 3.
ls_events-appl_event = gc_true.
APPEND ls_events TO lt_events.
CALL METHOD co_alv->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3
OTHERS = 4.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT co_alv_event_handler.
SET HANDLER: co_alv_event_handler->on_double_click FOR co_alv.
CALL METHOD co_alv->set_toolbar_interactive.
3. In the PAI module of Screen, tried to handle the event 'OK' that waqs registred in PBO.
CASE save_ok.
WHEN 'OK'.
Get selected line
CALL METHOD io_alv->get_selected_rows
IMPORTING
et_index_rows = lt_rows
et_row_no = lt_rows_no.
IF NOT lt_rows IS INITIAL.
READ TABLE lt_rows INTO ls_rows INDEX 1.
IF sy-subrc EQ 0.
gv_selected = 'X'.
READ TABLE it_req
INTO ls_req
INDEX ls_rows-index.
e_req_id = ls_req-zzrequest_id.
SET SCREEN 0.
ENDIF.
ELSE.
SET SCREEN 0.
ENDIF.
With this code what is happening is, when user double clicks a line on Pop-up screen with ALV grid data, the program is able to successfully get into the class implementation but the control is not going to PAI module to execute the OK_code handling part.
Am I doing this in the right way? Appreciate quick suggestions. Proper posts will be thoroughly awarded with points.
Thx.
MinniPut your code into the Event handler Implementation of Double Click which is there in the PAI Module.
Regards,
Naimesh Patel -
Single (instead of Double) click for af:table editingMode="clickToEdit"
Hi all,
My af:table has editingMode="clickToEdit".
A row becomes editable by double clicking on it - this is a default.
How can I overide this editable behaviour with ONLY SINGLE click instead of Double?
Thanks.Ok, I can overirde the selection listener,
but inside that method I do not want to: setEditingMode("editAll");
I still want the table to have editingMode="clickToEdit".
But I want with only one click (instead of double) the row to be editable.
So one row editable at the time.
But only one click to show input fields.
The tabel does not have a property (number of clicks to make the row editable) that I can control.
In RichTable class it sais:
In "clickToEdit" mode a single row editable at a time. A row becomes editable by double clicking on it.
Can I overide this with: one click on the row???
And for sure I do not want to PPR the table since default double click on the table do not refresh the whole table.
Thanks.
Edited by: VesnaS on 15-Jan-2010 10:47 AM -
I need to allow selection of table row on double click - I implemented this functionality as suggested in article "http://technology.amis.nl/blog/3845/adf-11g-richfaces-handling-the-client-side-double-click-to-invoke-a-server-side-operation". I noticed the double click works fine if I click on any part of the row that is empty (without text). If i double click on the text that is displayed on the column cell - it just highlights the text and does not invoke Java script method for handling double-click event. I have set table 'rowselection' to 'single'. I am using Jdeveloper 11.1.5 and Firefox (3.1.16) browser.
Any one else has experienced this issue, is there any solution for this.Thanks Timo for your response. I am seeing this odd behavior when using pageflowscope managed bean.
1). I have a page (part of unbounded taskflow) that has commandlink which invokes a task flow as dialog (inline-popup):
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" title="testw">
<af:form id="f1">
<af:panelGroupLayout id="pgl1">
<af:commandLink text="Link"
id="cl1" useWindow="true"
immediate="true"
windowHeight="500" windowWidth="600"
windowEmbedStyle="inlineDocument"
inlineStyle="text-align:left;"
action="testflow"/>
</af:panelGroupLayout>
</af:form>
</af:document>
</f:view>
</jsp:root>
2). The inline popup has a table where I am using double click event on a row.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
<af:form id="f1" clientComponent="true">
<af:table value="#{TestdblClick.list}" var="row"
rowBandingInterval="0" id="t1" rowSelection="single"
clientComponent="true" binding="#{TestdblClick.contactTable}"
emptyText="no data" columnStretching="last">
<af:clientListener method="dblkfunction" type="dblClick"/>
<af:serverListener type="doubleClickOnRow"
method="#{TestdblClick.doubleClick}"/>
<af:clientListener method="singlelkfunction" type="selection"/>
<af:serverListener type="singleClickOnRow"
method="#{TestdblClick.singleClick}"/>
<af:column sortable="false" headerText="Col1" align="start" id="c3"
rowHeader="unstyled">
<af:outputText value="#{row.col1}" id="ot1"/>
</af:column>
<af:column sortable="false" headerText="Col2" align="start" id="c2">
<af:outputText value="#{row.col2}" id="ot3"/>
</af:column>
<af:column sortable="false" headerText="Col3" align="start" id="c1">
<af:outputText value="#{row.col3}" id="ot2"/>
</af:column>
</af:table>
</af:form>
<f:facet name="metaContainer">
<af:resource type="javascript">
function dblkfunction(event) {
var source = event.getSource();
AdfCustomEvent.queue(source, "doubleClickOnRow",
},false);
function singlelkfunction(event) {
var source = event.getSource();
AdfCustomEvent.queue(source, "singleClickOnRow",
false);
</af:resource>
</f:facet>
</af:document>
</f:view>
</jsp:root>
TestdblClick.java
====================
public class TestdblClick {
public TestdblClick() {
private RichTable contactTable;
private List<Testdata2> list = null;
public List<Testdata2> getList() {
this.list = new Vector<Testdata2>();
Testdata2 t1 = new Testdata2 ("joe", "demaggio", "contact");
Testdata2 t2 = new Testdata2 ("joe2", "demaggio2", "contact");
Testdata2 t3 = new Testdata2 ("joe3", "demaggio3", "contact");
list.add(t1);
list.add(t2);
list.add(t3);
return list;
public void setList(List<Testdata2> list) {
this.list = list;
public void singleClick(ClientEvent clientEvent)
System.out.println("------single click------");
public void doubleClick(ClientEvent clientEvent)
System.out.println("------doubleclick------");
public void setContactTable(RichTable contactTable) {
this.contactTable = contactTable;
public RichTable getContactTable() {
return contactTable;
If I make "TestdblClick" managed bean as request scope to handle double-click event it works fine, however if I make "TestdblClick" managed bean as pageflow scope (task flow) it does not work when double click is on a text within the table row. I am not sure why pageflowscope should impact the double-click behavior. -
I see slis everywhere while trying to handle double click
I want to handle double click event of the alv grid but I could not reach any problem solving answer in documents.
Am I required to write a class to handle user clicks on alv grid?
Please send me a code segment on this subject. The procedure also would be very helpful.
Thanks in advance.hi,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' Or list display
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND' " FORM NAME
IT_FIELDCAT = GT_FIELDCAT
TABLES
T_OUTTAB = ITAB
Here comes the interaction part
FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM. "system fileds
When '&IC1'. "this is Fcodce for double click
if rs_selfield-fieldname = '<your field name>' "give the field name on whcih you will double click
Write your code here..
fetch data from DB tables and put in internal tables and again use reuse_ALV_grid_display function module you will get interactive list
else
you can use "REUSE_ALV_POPUP_TO_SELECT"
to show the details in a small window..
endif.
endcase.
ENDFORM.
rewards if useful
regards,
nazeer -
How to have double click on trackpad in Lion?
I am not sure how to enable double click on trackpad in apple as i am used to?
In the Trackpad option of System Preferences, just select Secondary click in the Point & Click panel, then you have choice between different options.
-
How to avoid double-click to click-box
Hello,
until now I did not find a solution for this problem:
I have created a training course for a specific application, and in this coure are some click boxes on which the user should click. On many click boxes should the user click only once but if he double-click the click box, in real application nothing happens. There is only one way to succes the action - one click. But in captivate when the user double-click the click box instead of one click it evaluate as success action (the click box is set only to one click, double-click checkbox is not checked).
So my question is, is there any way how to avoid double-click in cases where the user should click only once? Or in case he double-click the click box to show failure caption?
Many thanks.
LukasHi all
Interesting thread. Unfortunately, what would be needed here is some sort of a widget that would run some internal timer. Sure, you can try multiple Click Boxes and configure one with a Single Click and one with a Double Click. But the problem with that (as I see it) is regardless of what you might try, the Single Click will win out every time. Thus you would need a widget of some sort that would "listen" for a Double Click and respond appropriately.
Tough call... Rick
Click here for Adobe Authorized Captivate and RoboHelp HTML Training
Click here for the SorcerStone Blog
Click here for RoboHelp and Captivate eBooks
Maybe you are looking for
-
HT201303 forgot security question answers, really
Cannot purchase music due to security question answers forgotten. Really , I purchase itunes card, can select music but before it downloads Itunes asks for my security questions, not just passsword, cannot use $25 in itunes credit, but iphone apps u
-
Ipad cover doesn't allow swipe up for airplay on ios7
Help! I have downloaded ios7 on all our school ipads and because of the shape of our ipad covers, can no longer access airplay. We cannot swipe up as the cover is too chunky. Does anyone know of another way to access airplay other than the swipe up??
-
Hi Gurus, I'm new on OBIEE 11G and try to access a dashboard to look for a ticker. In other computer it displayed normally. I have install shockwave flash object 10.2.1531 and access other chart normally. Is anyone know what other add on that needed?
-
"Material is not the same for confirmation and delivery"
Hello If this is not the right forum, my apologies. Direct me to the correct one if it is not .... Have been doing automated test development (HP's QTP) against SAP systems for over a year. I am not an application expert - very much a newbie when it
-
Logo image in titles disappear when open project on other PC
Hi You all! Got a problem with Premiere Pro CS5 regarding titles. We´re a group of people who uses the same CS5-project file as a template (write protected) from a server out on different computers. For each new project we open the template-project f