cancel
Showing results for 
Search instead for 
Did you mean: 

transition paramaters between two portal components

Former Member
0 Kudos

Hello,

In a portal application I have two portal components. In a portal component I have:

...

Object val=get_index.getSelection();

request.getComponentSession().putValue("session_id",val);

..

..

In the other one portal component I have:

Object value=request.getComponentSession().getValue("session_id");

The value is null.

What is wrong here ?

How could I do transiting a parameter from a portal component to other portal component in the same portal application ?

Best Regards.

Altafin

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Altafin,

I assume that you want to share the data for one user session, but between different components. So please use HTTP Session. The PortalComponentSession is bound to the - surprise surprise - component. And not shared between different components.

Within the Java Developer Role, also see: Java Development - Documentation - Services - Basic Functionality - Beans.

Hope it helps

Detlev

Former Member
0 Kudos

Hello Detlev,

I don't see. I read the documentation, my scope is application

In the a DynPage the below line it's working

public void onClick(Event event) throws PageException

{

..

..

..

request.getComponentContext().getProfile().putValue("s_id", get_index.getSelection());

..

..

..

}

So, now I want to "read" the <b>s_id</b> value in other DynPage within the same portal application:

Object value = request.getComponentContext().getProfile().getValue("index")

value is null

Best Regards.

Altafin

detlev_beutner
Active Contributor
0 Kudos

Hi Altafin,

you have marked the question as answered and gave 10 points (thanks!), but from your answer I see that there are remaining problems, right?

The problem is that SAP has mixed up some terms, not only against the J2EE rules but also very confusing within the portal sphere. The doc is not very well and really differentiating examples are missing. Most people learn this topiv by trial&error...

Here, you just have to read carefully one thing:

"In the portal the sphere for APPLICATION is defined as the portal component." Component! Not Application!

And: The profile is component-dependent, this you can already realize from portalapp.xml.

So it was the right choice to award 10 points for the last answer, because it should have solved your question more or less completely - use HTTP Session for your needs:

First component:


HttpSession session = request.getComponentSession().getHttpSession();
session.setAttribute(("s_id", get_index.getSelection());

Second component:


HttpSession session = request.getComponentSession().getHttpSession();
session.getAttribute("s_id");

Hope it helps

Detlev

PS: Be aware of "s_id" used both times - in your example, you have used "s_id" to store and "index" to retrieve the value - this won't do even if the other problems wouldn't be there...

Answers (0)