7 Replies Latest reply: Feb 28, 2012 6:40 AM by Pooja Agrawal RSS

Custom Controller Issue

Currently Being Moderated

Dear Friends,

 

I have add a custom assignment block on the overview page to show the data of a custom table. To add assignment block, I have

created a new view and have added value node with the attributes as per requirement. I have also added edit, insert and delete buttons there. All the things are working fine but Save is not working. To save data, I have used custom controller and trying to fetch data in the overview page controller class, but the custom controller is not reflecting the new value(added/modified), it only shows the previous value. So I am not able to save the changes in the custom table and I want to save the changes only though the save button on overview page..

 

Please help in this regard.

 

Thanks a lot !

  • Re: Custom Controller Issue
    Nithish PP
    Currently Being Moderated

    Hi John,

     

    Are you binding Custom controller context node to your view context node or are you trying to fill the custom controller context node whenever edit or insert event occurs?

     

    Regards,

    Nithish

  • Re: Custom Controller Issue
    siva krishna
    Currently Being Moderated

    Hi John Right ,

     

    bind your custom view context node to your custom controller context node then all the changes are reflected to customer controller. then you know all the procedure to fetch data from custom controller .

     

    Regards

    Siva

    • Re: Custom Controller Issue
      Currently Being Moderated

      Hi Nithish/Siva,

       

      I have already binded the view context node to custom controller context node bui some how the changes is not getting reflected in the custom controller.This is the point where I have got stuck.

       

      Thnks a lot !

      • Re: Custom Controller Issue
        Nithish PP
        Currently Being Moderated

        Hi John,

         

        While adding/modifying attribute in the Custom Assignment Block , in the debug mode after setting the attribute check out the current entity ,and compare with the entity in custom controller at that point .It should maintain the same instance.As your view is in overview page , the custom controller should still be active when it reaches ON_SAVE event.

         

        Regards,

        Nithish

      • Re: Custom Controller Issue
        Suvidha Maheshwari
        Currently Being Moderated

        It is possible that the collection in the custom controller is being overwriteen by some toher istance of the same context node.

        Possibly you should put a breakpoint in methods like DO_PREPARE_OUTPUT, or other methods which are calle don rounttrips.These are the ones which will be called after you save method,and you will get an idea if any replacement to the entity is done here.

        also try to check the ON_NEW_FOCUS of the custom controller and the view context nodes.

         

        Suvidha

      • Re: Custom Controller Issue
        Pooja Agrawal
        Currently Being Moderated

        Hi John,

         

        To fetch the values of a view in overview you can use the following method.

         

        In the method of the overview page fetch the value of the view controller.

         

        Data: lr_viewctrl TYPE REF TO cl_bsp_wd_view_controller.
        
        lr_viewctrl = me->get_subcontroller_by_viewname( 'BT231H_ACQC/Contractview' ). "Here give your view name

         

        Now you can get the values of the view.

         

        Regards,

        Pooja

  • Re: Custom Controller Issue
    Harshit Kumar
    Currently Being Moderated

    John,

     

    It will be good if you can create a CN at Component controller level and use it for save. Make sure you bind it with View/Custom Controller Node. Once the save is done sucessfully make sure you refresh the entity.

     

    Also you should clear the old values once your view is loaded.

     

    Regards,

    Harshit Kumar

Actions