cancel
Showing results for 
Search instead for 
Did you mean: 

cannot redefine GET_BUTTONS

Former Member
0 Kudos

Hello,

I'm trying to add a button to a new View I have added using the Create View wizard in the Component Workbench, and I ticked the Toolbar button checkbox during creation.

However, I cannot redefine the IF_BSP_WD_DYN_TOOLBAR_CALLBACK~GET_BUTTONS method. This make sense as it does not exist in the View implementation class.

Do I need to add the interface manually? Or has the Wizard missed something and I should instead delete and recreate my View?

Many thanks,

Stuart.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Stuart,

If u want buttons in View you can add it in the Do prepare output  method.

otherwise  u want Buttons in Overview Page you need add Manually  interface IF_BSP_WD_TOOLBAR_CALLBACK and then activate the IMPL class TOOLBAR methods will enable.

Hope this one helpful if u want any clarification let me know.

Regards,

Vishwa

Former Member
0 Kudos

Thanks Vishwa, Praveen, both your suggestions almost worked for me.

Apparently Table Views handle buttons differently to other views. That was my problem.

I had to use a 3rd option supplied by a consultant.

Cheers,

Stuart.

Answers (2)

Answers (2)

chhanda_sarkar
Explorer
0 Kudos

HI Stuart,

Can you please tell me what logic u have done for this. I also have the same problem.

Regards,

Chhanda

Former Member
0 Kudos

Hello Chhanda,

I had to do this:

  1. Create an attribute of type CRMT_THTMLB_BUTTON_T on the implementation class to hold the buttons.
  2. Create an attribute of type I on the implementation class to hold the number of buttons.
  3. Redefine DO_PREPARE_OUTPUT with code like this for each button:

CLEAR gt_button_list.
ls_button-text     = 'My button'.
ls_button-enabled  = abap_true.
ls_button-on_click = 'Myaction'.

ls_button-type     = cl_thtmlb_util=>GC_ICON_ACCEPT.
APPEND ls_button TO gt_button_list.
GV_MAX_BUTTONS = GV_MAX_BUTTONS + 1.

In the html for your view, you need to have something like this:

  <chtmlb:configCellerator downloadToExcel       = "TRUE"
                         editMode         = "<%= lv_cellerator_editmode %>"
                         id                    = "ConfCellTable"
                         actions            = "<%= controller->GT_BUTTON_LIST %>"
                         actionsMaxInRow       = "<%= controller->GV_MAX_BUTTONS %>"

I think you have to use upper-case in the HTML or it will fail.

Please note there may be a better way of doing this, if anyone has a better method I'd love to learn it!

Stuart.

chhanda_sarkar
Explorer
0 Kudos

Hello Struart ,

Thank you for your answer.

I have solved my problem but little bit diffrent way.

I have follwed the following steps-

1. I have implemented the interface "IF_BSP_WD_DYN_BTN_CONTROL" in the impl class of my list  view.

2. Insert the folwing  2 lines code in between existing html code . ( after id i have written this)

 

actions =

"<%= controller->IF_BSP_WD_DYN_BTN_CONTROL~GET_LOCAL_TOOLBAR_BUTTONS( ) %>"
actionsMaxInRow =

"<%= controller->IF_BSP_WD_DYN_BTN_CONTROL~GET_NO_OF_VISIBLE_TOOLBAR_BTNS( ) %>".

 

3. Redefine toolbar methods :

   IF_BSP_WD_DYN_BTN_CONTROL~GET_NO_OF_VISIBLE_TOOLBAR_BTNS

   and

   IF_BSP_WD_DYN_BTN_CONTROL~GET_BUTTONS

regards,

chhanda

Former Member
0 Kudos

Hello Chhanda, 

 

All these methods are part of IMPL class of the view. So if you face problem in redefining any of such methods then you need to do it in _IMPL class only.

All the request processing , Toolbar related Methods ,Controller Initialization and Destruction , Breadcrumbs and Messages, Context related Methods will be part of IMPL class.

If you dont find any interface where in you want to redefine the method , then add that interface to this impl class.

The reason why the redefine button was not available was because the interface is not present in the IMPL class hence the method too.

Hope you got it,

THanks and Regards,

Nikhil Kulkarni.

chhanda_sarkar
Explorer
0 Kudos

Hello nikhil,

Yes I have got this.

Thank you for your details explanation.

regards,

Chhanda

praveen_kumar194
Active Contributor
0 Kudos

hi

in order to display buttons on view ,

just define one public parameter in your view implementation class GT_BUTTONS and fill this internal table in the DO PREPARE OUTPUT method with the buttons.

then  go to html page of your view and use the bsp tag areaframesetter tag

<thtmlb:areaFrameSetter toolbarButtons = "<%= controller->gt_buttons %>"

hope it helps.