Skip to Content
Aug 02, 2007 at 09:18 AM

Problem with get_cell_value


Hi all,

I have written this application, consists of 2 bsp-sites.

The .1 site includes an inputfield with the f4-help. The page-attribute is called

abc type string. the 2. site contains a tableview object with selectionmode "lineEdit". In the table I display the entries from table SPFLI from column CARRID.

If the user clicks on the f4-help of the inputfield (site 1), a Javascript Function is called, which opens the 2. site into a new window.

When a row of the tableview is selected, the value of the column shall be passed to site 1.

To test this, I created the pageattribute abc. The value of the cell shall be stored in abc and this value has to bo displayed into the inputfield of site 1.

Here is my code, but it doesn't work:

I assume, that there is an error in onInputProcessing.

<b>2. Site - Layout</b>

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title="Display Table " >

      TYPES: begin of line_spfli,
               carrid type spfli-carrid,
             end of line_spfli.

      DATA: itab_spfli type standard table of line_spfli,
            wa like line of itab_spfli.

      select distinct carrid from spfli into table itab_spfli.

      function pass_values(id)
         opener.document.getElementById('asset').value = id


    <htmlb:form id = "main_form">

      <htmlb:tableView  id = "table_Entries"
             headerVisible = "TRUE"
             selectionMode = "lineEdit"
                     table = "<%= itab_spfli %>" >


             <htmlb:tableViewColumn  columnName = "carrid"
                                       wrapping = "true"
                                          width = "100"
                            horizontalAlignment = "center" >





<b>OnInputProcessing (Site 2)</b>

* event handler for checking and processing user input and
* for defining navigation

DATA: event TYPE REF TO cl_htmlb_event,
      tv TYPE REF TO cl_htmlb_tableview,
      table_event TYPE REF TO cl_htmlb_event_tableview,
      selected_row_index TYPE selectedrow-index,
      cell_value TYPE string.

IF event_id = 'htmlb'.
  event = cl_htmlb_manager=>get_event( runtime->server->request ).
  CASE event->server_event.
    WHEN 'button_go'.
      tv ?= cl_htmlb_manager=>get_data( request = request
                                        name    = 'tableView'
                                        id      = 'table_Entries' ).
        table_event = tv->data.
        selected_row_index = table_event->selectedrowindex.

        cell_value = table_event->get_cell_value(
            row_index    = selected_row_index
            column_index = 1 ).

navigation->set_parameter( name = 'abc' value = cell_value ).
navigation->next_page( 'TOINDEX' ).

Message was edited by:

Alberto Colonna