Skip to Content

dropdownlistbox in iterator (mvc)

hi,

in my bsp i display a table via mvc iterator.

in the attributes of the iterator tab i have defined <b>m_row_ref as type ref of the table displayed</b>.

i have created as well a new field that i display in a dropdownlistbox.

this new field <b>does not belong to the table displayed</b>.

the question is:

<u>do i have to add this new field to the table so that m_row_ref contains it?</u>

<u>or is there another way to know which value of the dropdownlistbox has been selected?</u>.

Best regards.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Sep 20, 2007 at 08:08 AM

    Hi,

    sorry but i don´t get it.

    i´ll try to add more information.

    in the RENDER_CELL_START method i do:
    CASE p_column_key.
    WHEN '

    THEFIELDTHATDOESNOTBELONGTOROWREF

    '
    wa-name = 'name'.
    wa-value = 'value'.
    APPEND wa TO table.

    GET REFERENCE OF table INTO table_ref.
    p_replacement_bee = cl_htmlb_dropdownlistbox=>factory(
    id = p_cell_id
    selection =

    selection

    table = table_ref

    nameofkeycolumn = 'NAME'

    nameofvaluecolumn = 'VALUE' ).

    i ´m still not able to get a value in field "selection"

    Best regards.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      First make sure you declare the column in the <b>GET_COLUMN_DEFINITIONS</b> method...

      Then Just try and put this code in <b>RENDER_CELL_START</b>.

       FIELD-SYMBOLS : <fs> type any ,
                        <l_field> type any.
       
        assign p_row_data_ref->* to <fs>.
       
            ASSIGN COMPONENT 'your_column_name' OF STRUCTURE <fs> TO <l_field>.
            if <l_field> is assigned .
              selection = <l_field> .
            endif .

      the component your_column_name has to be in your table...as you will need some value in your DDLB...

      Hope this helps.

      <b><i>Do reward each useful answer..!</i></b>

      Thanks,

      Tatvagna.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 08:21 PM

    Hi,

    In the Attribute of the Iterator decalre a table which hold the key and the value.

    Example

    LT_SEQ_NO	Instance Attribute	Public	Type	CRMT_PRT_MAP

    Populate the this table where ever you feel comfortable. I would declare constructor method of the iterator and populate it there.

    go to method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START

    METHOD IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
      DATA: lo_text     TYPE REF TO cl_htmlb_textview,
            lo_ddlb     TYPE REF TO cl_htmlb_dropdownlistbox.
    
      FIELD-SYMBOLS: <dat> TYPE ANY.
    
      row_ref = p_row_data_ref.
    
      CASE p_column_key.
    
        WHEN 'SORT_NUM'.
          CREATE OBJECT lo_ddlb.
          GET REFERENCE  OF lt_seq_no INTO lo_ddlb->table.
          lo_ddlb->id = p_cell_id.
          lo_ddlb->nameofkeycolumn   = 'ENTRY_KEY'.
          lo_ddlb->nameofvaluecolumn = 'ENTRY_VALUE'.
          lo_ddlb->selection = get_column_value( p_column_key ).
          p_replacement_bee = lo_ddlb.
        WHEN OTHERS.
          CREATE OBJECT lo_text.
          lo_text->id       = p_cell_id.
          lo_text->wrapping = 'FALSE'.
          lo_text->text     = get_column_value( p_column_key ).
          lo_text->design   =  'STANDARD'.
          p_replacement_bee = lo_text.
      ENDCASE.
    
    ENDMETHOD.

    Modify the method as per your need.

    Amandeep

    <b><i>Do reward points for each usefule answer</i>.</b>

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Alternatively, you can use this code snippet to get the value of any column.

       FIELD-SYMBOLS : <fs> type any ,
                        <l_field> type any.
      
        assign p_row_data_ref->* to <fs>.
      
            ASSIGN COMPONENT your_column_name' OF STRUCTURE <fs> TO <l_field>.
            if <l_field> is assigned .
              lw_rgid = <l_field> .
            endif .

      There is no need to declare an additionally column...if you just want values from any other column....then you can use the above snippet....

      Hope this helps.

      <b><i>Do reward each useful answer..!</i></b>

      Thanks,

      Tatvagna.

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.