Hello Sergeant and all MC Expert .
Sorry!! but I need your Help!!
when I use your Code work perfect, but if I expand it, then does not work.
I mean if I call the controller(zsk_temp1.do ) from a View (default.htm).
My Aplication has 2 Controllers and 2 views:
<u>Controller:</u>
<u>View:</u>
Have you any Idea why can i not get know the selected Rows???
I think is somting with "dispatch_input( )."
Thank's
Regards.
dav.
-
View: First.htm
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page title="First page " >
<htmlb:form>
<htmlb:textView text = "Hello World!"
design = "EMPHASIZED" />
<htmlb:button text = "Press Me"
onClick = "myClickHandler" />
<htmlb:group id = "rate_zwei"
design = "sapcolor" >
<htmlb:groupHeader>
<htmlb:textView id = "testgroup2"
text = "Test group"
textColor = "black"
layout = "PARAGRAPH"
width = "400" />
</htmlb:groupHeader>
<htmlb:groupBody>
<htmlb:tableView id = "tv1"
width = "100%"
visibleRowCount = "8"
design = "ALTERNATING"
footerVisible = "TRUE"
selectionMode = "MULTISELECT"
table = "<%= controller->itab_flight %>"
selectedRowIndexTable = "<%= controller->TABLE %>"
selectedRowIndex = "<%= controller->v_index %>" >
</htmlb:tableView>
<p>
<htmlb:button id = "test"
onClick = "test"
text = "test" />
</htmlb:groupBody>
</htmlb:group>
</htmlb:form>
</htmlb:page>
</htmlb:content>
View : default.htm
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<htmlb:content id = "ComponentTest"
design = "CLASSIC+DESIGN2002+DESIGN2003" >
<htmlb:page title="TEST" >
<htmlb:form id = "myFormId"
method = "post"
encodingType = "multipart/form-data" >
<htmlb:tray id = "tray1"
title = "Merkmale "
design = "form"
width = "100%"
isCollapsed = "false" >
<b><bsp:call url = "zsk_temp1.do"
comp_id = "zsk" ></b> </bsp:call>
</htmlb:tray>
</htmlb:form>
</htmlb:page>
</htmlb:content>
Controller: default.do
method DO_REQUEST. DATA: main_view TYPE REF TO if_bsp_page. dispatch_input( ). main_view = create_view( view_name = 'default.htm' ). call_view( main_view ). endmethod.
Controller: zsk_temp1.do
ZCL_SREE_FIRST
Controller Class for zsk_temp1
INHERITED FROM:CL_BSP_CONTROLLER2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CLASS IMPLEMENTAION
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
" local class implementation for public class
" use this source file for the implementation part of
" local helper classes
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CLASS TYPES
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
" use this source file for any type declarations (class
" definitions, interfaces or data types) you need for method
" implementation or private method's signature
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CLASS MACROS
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
" use this source file for any macro definitions you need
" in the implementation part of the class
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*********************************************************
ATTRIBUTES
-
ITAB_FLIGHT INSTANCE ATTRIBUTE PUBLIC TYPE ZSFLIGHT sflight
INDEX INSTANCE ATTRIBUTE PUBLIC TYPE S_INDEX
TABLE INSTANCE ATTRIBUTE PUBLIC TYPE INT4_TABLE Standard Table of INT4
V_INDEX INSTANCE ATTRIBUTE PUBLIC TYPE SY-INDEX Loops, Current Loop Pass
*********************************************************
METHODS
-
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
method do_handle_data.
*CALL METHOD SUPER->DO_HANDLE_DATA
EXPORTING
FORM_FIELDS =
GLOBAL_MESSAGES =
.
data: it_formfields type ihttpnvp.
*
read table form_fields into it_formfields with key name = 'tv1'.
endmethod.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
method do_handle_event.
data:
table_event type ref to cl_htmlb_event_tableview,
table type ref to cl_htmlb_tableview ,
selectedrows type selectedrows.
case event.
when 'test'.
table ?= cl_htmlb_manager=>get_data( request = request
name = 'tableView'
id = 'tv1' ).
table_event ?= table->data.
call method table_event->get_rows_selected
receiving
selected_rows = selectedrows.
endcase.
endmethod.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
method do_init.
*CALL METHOD SUPER->DO_INIT
.
select mandt
carrid
connid
fldate
price
currency
planetype
seatsmax
seatsocc
paymentsum
seatsmax_b
seatsocc_b
seatsmax_f
seatsocc_f
up to 10 rows
from sflight
into table itab_flight.
endmethod.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
method do_request.
*CALL METHOD SUPER->DO_REQUEST
.
*write( '<html><body> ' ).
write( 'This is my very first controller' ).
write( '</body></html>' ).
*
data: myview type ref to if_bsp_page.
dispatch_input( ).
myview = create_view( view_name = 'First.htm' ).
call_view( myview ).
endmethod.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
EVENTS
-
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
TYPE-GROUPS
-
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
INTERNAL TYPES
-
S_INDEX PUBLIC[/nobr]