Skip to Content

How to Start(!) a Component from another Component

Hi there,

my question of today is the following:

I have a component A (working standalone) and a component B, which makes use of component A. To be visual: A is a three-step wizard, B is a table to choose from.

Now I want to start component A (the wizard) whenever the user chooses a new row in B. What I have is component B calling the interface view of component a, bypassing a parameter. This works. But when the user moves forward within the wizard, from step 1 to step 2 within component A, and then chooses another row in component B, the parameter is passed, I can update the context, but the view does not change - but I want to start over this component. The inbound plug of the interface view is marked as a startup plug, I do not really know if this should concern my question (doc is a bit short again on this).

Any help?

Thanks in advance

Detlev

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    May 07, 2004 at 05:04 AM

    Hi Detlev,

    here's my solution of the day:

    1. Change the Lifecycle property of the component usage of A owned by B to "manual".

    2. Whenever the user selects a row, delete and recreate A (-> full "restart"):

        if (wdThis.wdGetAComponentUsage().hasActiveComponent()) {
          wdThis.wdGetAComponentUsage().deleteComponent();
        }
        wdThis.wdGetAComponentUsage().createComponent();
    

    3. Fire the plug to A passing the parameter(s) as already done. If the InterfaceView of A is the default for the view area it resides in, it will be displayed by the component creation of A already, so firing the plug is just for transporting the parameters(s) in that case.

    4. In wdDoExit() of the component controller of B, delete the component A for a full cleanup (maybe that's automatically done by the framework, but who knows):

        if (wdThis.wdGetAComponentUsage().hasActiveComponent()) {
          wdThis.wdGetAComponentUsage().deleteComponent();
        }
    

    5. What you are doing here is a navigation inside an already running application, so there's no need to use startup plugs for that.

    Hope that helps.

    Best regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Stefan,

      1.) That's what I thought when I created the component usage.

      2.) Hm. When a tried around, I thought that this should be possible, I even thought to have tried to mark this, but it seems that I was not really up in mind. Tried again now, and it worked (if I was Gollum, I would beat me now. Thanks god, I'm not 😉

      3.) & 4.) & 5.) I completely agree.

      Now I am really happy with my solution.

      Thanks, thanks, thanks & have a nice weekend!

      Best regards

      Detlev