Skip to Content
0
Aug 04, 2009 at 10:47 PM

MVC Creating (Custom-/Fake-HTMLB) Event for SubController

23 Views

Hi experts,

I have the following requirement:

I want to create in main controller an event that triggers the same action like a mouse click on a htmlb_link. So that while going through the normal dispatch_event( ) an event for subcontroller_2 is created and followed like a normal link event in htmlb.

BSP Application like this

creating

Maincontroller -> subcontroller_1

-> subcontroller_2

calling calling

Maincontroller -> index.bsp -> list_view

-> content_view

I'm reading a URL-Paramter in MainController (like: product=XYZ) and I want to react in subcontroller_2 with getting some data and displaying the appropriate view, which I normally get, when I click a link on another page in subcontroller_1 which is an htmlb_event, type link which says show_XYZ.

So when I get the URL Param, I can prepare the data for displaying but I cannot trigger the same event like "htmlb_event:link:click:null" , like it is triggered when the link is clicked by user and processed the normal way in dispatching through dispatch_input() in maincontroller and do_handle_data, do_handle_event, do_finish_input in sub_controller.

Hope the situation is somehow clear.

Here my questions:

1) Is it possible to create an htmlb_like event without user interaction?

2) If 1 is not possible how can I create an custom_event which is triggered in dispatch_input() of maincontroller (inheriting from cl_bsp_controller2)? Because now maincontroller is leaving while checking for events ...

CL_BSP_CONTROLLER2->dispatch_input().

*  do nothing, if no event is found
  if request->get_form_field( event_name ) is initial.
    return.
  endif.

Thank you for any advice.

Best regards

Volker

Edited by: Volker Ritzau on Aug 5, 2009 12:47 AM