cancel
Showing results for 
Search instead for 
Did you mean: 

Adding New Row to Assignment Block

Former Member
0 Kudos

Hi,

I created a custom table assignment block to the Membership overview page. The context node is a custom model context node.

There is an "Add" button present to add new entries to the AB. In the Add button I have added the code:

 

lr_entity - root object entity.

      lr_tx ?= lr_entity->get_transaction( ). 

me->view_group_context->set_view_editable( me ).

      me
->view_group_context->set_associated_tx_context( lr_tx ).

      lr_partmsh_entity
= lr_entity->create_related_entity( 'XXXXX' ).

     
IF  lr_partmsh_entity IS BOUND.


        lr_partmsh_entity
->deactivate_sending( ).

        typed_context
->yparticmsh->collection_wrapper->add( lr_partmsh_entity ).

     
ENDIF.

When I click on the Add button, a new line is getting added. But it is not editable. And the GET_I methods of the attributes of the table AB is not getting called.

Please provide some valuable suggestions.

Regards,

Heera

Accepted Solutions (1)

Accepted Solutions (1)

faisal_pc
Active Contributor
0 Kudos

Hi Heera,

Yours is table view right?. Here is how you can resolve it.

1) Create an attribute gv_editable with type char4.

2) Go to your htm page and put the following code.

editMode          = "<%= controller->gv_editable %>"

3) Go to your insert button event handler and add the following code.

gv_editable = 'ALL'.

You are done with.

Thanks,

Faisal

Answers (1)

Answers (1)

former_member210661
Active Contributor
0 Kudos

Hi Heera Ramanunny,

when ever you have created table view in that there is a method do_init_context double click on that method and change at last select_single into select_multiedit. then we can edit table filed..

snippet code:

typed_context->contextnode->set_selection_mode(lv_selection_mode = cl_bsp_wd_context_node_tv=>select_ multiedit).

and write the this code in your add button.. it might help full to edit all the fields

types : BEGIN OF TY_LINE,

                ex type table-fieldname.  " decalre your fileds like this

                ex1 type table-fieldname1.

        END OF TY_LINE.

  data :  lr_valuenode type ref to cl_bsp_wd_value_node,

            wa_line type ref to ty_line.

  CREATE DATA wa_line.

  CREATE OBJECT LR_VALUENODE

    EXPORTING

      IV_DATA_REF = wa_line.

  typed_context->contxtnode->collection_wrapper->add(  lr_valuenode ).

Thanks & Regards

Srinivas