on 06-07-2004 12:20 PM
Hallo,
due to Brian McKellar's Weblog "BSP Programming: HTMLB Table View Iterator" I created a BSP-Application. I have problems to fill the dropdownlist.
The reference me->m_currencies_ref is filled but there is no entry in the dropdownlist:
p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
id = p_cell_id
selection = m_row_ref->CURRENCY
table = me->m_currencies_ref
nameOfKeyColumn = 'NAME'
nameOfValueColumn = 'VALUE' ).
Many thanks for any help
Andreas
Andreas
Andreas,
Will it help you if I append my example code enblock? Should I do it in future for all weblogs so that you do not have to type it in?
++bcm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
class CL_BCM_SDN_ITERATOR definition
public
create public .
public section.
interfaces IF_HTMLB_TABLEVIEW_ITERATOR .
protected section.
data M_ROW_REF type ref to SFLIGHT .
data M_CURRENCIES type TIHTTPNVP .
data M_CURRENCIES_REF type ref to DATA .
endclass.
class CL_BCM_SDN_ITERATOR implementation.
method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
FIELD-SYMBOLS: <currency> TYPE IHTTPNVP.
CLEAR me->m_currencies.
APPEND INITIAL LINE TO me->m_currencies ASSIGNING <currency>.
<currency>-NAME = 'USD'. <currency>-value = 'US Dollar'.
APPEND INITIAL LINE TO me->m_currencies ASSIGNING <currency>.
<currency>-NAME = 'EUR'. <currency>-value = 'Euro'.
APPEND INITIAL LINE TO me->m_currencies ASSIGNING <currency>.
<currency>-NAME = 'ZAR'. <currency>-value = 'SA Rand'.
GET REFERENCE OF me->m_currencies INTO me->m_currencies_ref.
FIELD-SYMBOLS: <def> LIKE LINE OF p_column_definitions.
* First column is small icon.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'ICON'.
<def>-TITLE = ' '.
* Next display standard columns from table: CARRID, CONNID, FLDATE,
* PRICE, CURRENCY & PLANETYPE
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'CARRID'.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'CONNID'.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'FLDATE'.
<def>-EDIT = 'X'.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'PRICE'.
<def>-EDIT = 'X'.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'CURRENCY'.
<def>-EDIT = 'X'.
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'PLANETYPE'.
* Finally we add new column for seats
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'SEATS'.
<def>-TITLE = 'Seats'(001).
<def>-EDIT = 'X'.
endmethod.
method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
CASE p_column_key.
WHEN 'ICON'.
DATA: icon_plane TYPE STRING.
icon_plane = CL_BSP_MIMES=>SAP_ICON( id = 'ICON_WS_PLANE' ).
p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY( id = p_cell_id src = icon_plane ).
WHEN 'FLDATE'.
IF p_edit_mode IS NOT INITIAL.
DATA: date TYPE STRING.
date = m_row_ref->FLDATE.
p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(
id = p_cell_id
value = date
type = 'DATE'
showHelp = 'TRUE'
cellValue = 'TRUE' ).
ENDIF.
WHEN 'CURRENCY'.
IF p_edit_mode IS NOT INITIAL.
p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
id = p_cell_id
selection = m_row_ref->CURRENCY
table = me->m_currencies_ref
nameOfKeyColumn = 'NAME'
nameOfValueColumn = 'VALUE' ).
ENDIF.
WHEN 'SEATS'.
IF p_edit_mode IS INITIAL.
DATA: max TYPE STRING,
occ TYPE STRING,
value TYPE STRING.
max = m_row_ref->SEATSMAX + m_row_ref->SEATSMAX_B + m_row_ref->SEATSMAX_F.
occ = m_row_ref->SEATSOCC + m_row_ref->SEATSOCC_B + m_row_ref->SEATSOCC_F.
CONDENSE: max, occ.
CONCATENATE occ ` / ` max INTO value.
p_replacement_bee = CL_HTMLB_TEXTVIEW=>FACTORY( text = value ).
ELSE.
DATA: if_first TYPE REF TO CL_HTMLB_INPUTFIELD,
if_bus TYPE REF TO CL_HTMLB_INPUTFIELD,
if_econ TYPE REF TO CL_HTMLB_INPUTFIELD.
if_first = CL_HTMLB_INPUTFIELD=>FACTORY( id = p_cell_id id_postfix = '_first' type = 'INTEGER' size = '4' ).
if_first->VALUE = m_row_ref->SEATSOCC_F.
if_bus = CL_HTMLB_INPUTFIELD=>FACTORY( id = p_cell_id id_postfix = '_bus' type = 'INTEGER' size = '4' ).
if_bus->VALUE = m_row_ref->SEATSOCC_B.
if_econ = CL_HTMLB_INPUTFIELD=>FACTORY( id = p_cell_id id_postfix = '_econ' type = 'INTEGER' size = '4' ).
if_econ->VALUE = m_row_ref->SEATSOCC.
DATA: seats_bee TYPE REF TO CL_BSP_BEE_TABLE.
CREATE OBJECT seats_bee.
seats_bee->ADD( if_first ).
seats_bee->ADD( if_bus ).
seats_bee->ADD( if_econ ).
p_replacement_bee = seats_bee.
ENDIF.
ENDCASE.
endmethod.
method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START.
m_row_ref ?= p_row_data_ref.
endmethod.
endclass. "CL_BCM_SDN_ITERATOR implementation
<b><u>OnLayout</u></b>
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2002">
<htmlb:page>
<htmlb:form>
<htmlb:tableView id = "tv1"
visibleRowCount = "5"
selectionMode = "lineEdit"
table = "<%=flights%>"
iterator = "<%=iterator%>" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
<b><u>OnCreate</u></b>
SELECT * FROM SFLIGHT INTO TABLE flights.
CREATE OBJECT iterator TYPE CL_BCM_SDN_ITERATOR.
runtime->keep_context = 1.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.