Skip to Content
0
Former Member
Apr 28, 2004 at 07:51 AM

Passing control from one component to another

41 Views

Hi,

I have a question regarding inter-portal-component communication.

The scenario is as follows: Component A performs the actual task and is the 'main' component. Component B performs a search task.

Both components are JSPDynPages ie derived from PageProcessorComponent

The idea is that component B should be a working component in its own right, and should be 'callable' from within other components. In my case component A has a search button which fires an event to component A. A's handler handler then redirects to B ie handing control to B. The state of A is stored in the user session to be restored once B returns. The scenario is modelled on function/procedure call semantics.

Once the request is redirected to B the user should now interact with B, search, scroll etc until the desired object is found. When the user clicks 'select' B stores the found items in the session (for retrieval by A) and hands control back to A, again via a redirect.

Thus far I'm able to perform the redirect:

import com.sapportals.portal.prt.component.IPortalComponentContext;

import com.sapportals.portal.prt.component.IPortalComponentRequest;

import com.sapportals.portal.prt.component.IPortalComponentResponse;

import com.sapportals.portal.prt.pom.INode;

import com.sapportals.portal.prt.pom.IComponentNode

. . .

INode myNode = request.getNode();

IPortalComponentContext cntxt = request.getComponentContext("Component B");

IComponentNode cnode = myNode.getPortalNode().createComponentNode(REDIRECT_NAME, cntxt);

response.include(request, cnode);

. . .

The problem is that even though the search page of B appears after the redirect, subsequent events are still directed to Component A.

I have even tried specifying the 'action' attribute in the <htmlb:form> tag but that didn't work either.

I'm relatively new to the whole portal thing, and my thinking is still in the servlet paradigm, so any help putting me on the straight and narrow would be appreciated 😊

Cheers

Michael.