Skip to Content
author's profile photo Former Member
Former Member

HTMLB - tableview input field

Hi there,

I am using a Tableview with an inputfield within one of the Tableview columns. Once a user enters data into this field, how do you access this data that has been entered? Is there a method to read the values within a specific cell within a tableview if you have the column & row indexes? Any example code would be great.

Kind regards

Anthony

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Oct 16, 2003 at 12:48 PM

    Hi!

    Did you use HTMLB for Java or for ABAP? Can u plz add a your coding?

    Oliver

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Oliver,

      I've done all this TableView functionality in Java and am now needing it to work for a "proof of concept" BSP iView.

      In Java I usually do something like the following to get the values out of InputFields rendered on the TableView:

      public void onNavigate(Event ev) throws PageException {

      AbstractDataType forexComponent;

      .......

      ......

      myTableView = (TableView) getComponentByName("da190Table");

      .....

      ....

      myTableModel = myDA190Bean.getTableModel();

      .....

      ....

      for(int i = firstrow; i <= lastrow_model; i++){

      .....

      forexComponent = componentPageContext.getDataForComponentId("da190Table", _

      "txtForexComponent" , loopcount);

      .....

      .....

      myTableModel.setValueAt(forexComponent, i, 6);

      }

      }

      I would assume it is probably very similar on the BSP side as well...

      DATA: table TYPE REF TO cl_htmlb_tableview,

      table_event type ref to CL_HTMLB_EVENT_TABLEVIEW,

      itmprice TYPE string.

      table ?= CL_HTMLB_MANAGER=>GET_DATA( request = request

      name = 'tableView'

      id = 'tv1' ).

      table_event ?= table->data.

      itmprice = table_event->GET_CELL_VALUE(

      row_index = p_row_index

      column_index = p_column_index ).

      I know this is way off the mark (bear in mind this was coded in "probably" the wrong place to start with....it's in the "IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START")....was just for testing though...

      I would obviously like it to be similar to the Java way of doing it using the TableView's underlying MODEL....and surely there must be something similar to "AbstractDataType" in ABAP???

      Anyway I hope this helps in seeing what our problem is....any help will be greatly appreciated!!!

      Regards

      Anthony

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2003 at 05:25 PM

    Anthony,

    It's very simpel to get the cell value. I assume thet you use HTMLB controls and controller.

    In the Controller class there is a method called DO_HANDLE_DATA, it has Form_fields as one of the parameters. This has name value pair for the data enetred on the screen, Loop through this table of name value pair, check for the table event and then get the values you are looking for.

    Another method is using Iterator interface into the controller and make use of it.

    Hope it helps.

    -Suresh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 03:51 AM

    Hi,

    I am using a Tableview with an inputfield within one of the Tableview columns. Once a user enters data into this field, I want to store that modified row .

    For updating that row how can we recognise which cell has been entered? Is there a method to read the values within a specific cell within a tableview if you have the column & row indexes?

    I want to use ABAP code for that..

    Any example code would be great.

    Kind regards

    Santosh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.