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

Problem with get_cell_value

42 Views

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.
    %>

    <script>
      function pass_values(id)
      {
         window.close()
         opener.document.getElementById('asset').value = id
      }
    </script>

    <br>

    <htmlb:form id = "main_form">

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

             <htmlb:tableViewColumns>

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

             </htmlb:tableViewColumns>

      </htmlb:tableView>

    </htmlb:form>

  </htmlb:page>
</htmlb:content>

<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' ).
      IF tv IS NOT INITIAL.
        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 ).
      ENDIF.
  ENDCASE.
ENDIF.

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

Message was edited by:

Alberto Colonna