cancel
Showing results for 
Search instead for 
Did you mean: 

Changes in custom controller

Former Member
0 Kudos

Hi,

I have a web dynpro component wherein im using few custom controllers. These controllers have already mapped in existing views. Now i have some changes as i need to add few more attributes and node in that. Could anybody please help me how could i add these additional attributes in and more importantly how to make these new attributes visible in view controller.

Rgds

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Sudhashu,

To add new attributes to node in controller

  • Option1: if node is directly created without any structure reference, you can directly add context attributes inside node at custom controller
  • Option2: If node is created with structure reference, you need to change the structure or append fields into structure. Then try to update the attributes of node using the latest structure definition.

To update attributes from custom controller to view controller:

  •      After successful addition of attributes to context node, you can right click on NODE in view controller's context and choose the option "UPDATE MAPPING",  Now you will be able to see the attributes updated from custom controller

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hello Rama,

That is correct and i did exactly same. View controller has also been updated after update mapping. Problem here is: data of this node being passed to create a pdf document by using method create_pdf of class cl_wd_adobe_services. even after the mapping the changed attributes are not visible in form.

rgds

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Actually you need to re-bind the context to adobe form again. So that your new attributes can be found in form. Check out the context of interface of form.

Regards,

Rama

former_member197475
Active Contributor
0 Kudos

Hi Sudhanshu,

Check your coding that you used to pass node data to the CREAT_PDF method. Make sure that you pass the whole data structure else look ahead for all the local work area data.

BR,

RAM.

Former Member
0 Kudos

Hello Rama,

What do you mean by re-bind. could you please let me know more about this. Here is the method call:

DATA: data_source_node TYPE REF TO if_wd_context_node.

   data_source_node = wd_context->get_child_node( name = wd_this->wdctx_form_data ).

   data: file_data type xstring.

   data pdf_data type xstring.

   data: adobe type ref to cl_wd_adobe_services.

   CREATE OBJECT ADOBE

     EXPORTING

       I_FORM_NAME = 'FORM_NAME'.

   file_data = ADOBE->CREATE_PDF(

      ENABLED                = abap_true

      DATA_SOURCE            = data_source_node

*         DATA_XML               = DATA_XML

       LEGACY_EDITING_ENABLED = ABAP_TRUE

*         HIDE_TOOLBAR           = ABAP_FALSE

*         ATTACHMENTS            = ATTACHMENTS

         ).

Interface of form is xml based which is being passed above with reference to the node i have changed.

ramakrishnappa
Active Contributor
0 Kudos

Hi,

I was referring to rebinding of context while generation of adobe form interface.

But In your case you are using runtime service and your code should work with the updated attributes as well.

Try to activate whole component and check again.

Regards,

Rama

Former Member
0 Kudos

thats exactly i was hoping that it should take reference of updated attributes. i have activated everything but form still showing old attributes only.

Rgds