You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Christopher Marshall <ch...@avenue100.com> on 2010/02/13 17:21:31 UTC
Detect Menu Click vs. Refresh or Portlet Url
We have a pair of portlets that use events and display BIRT reports
with in Jetspeed that allow the end-user to select date ranges and
drill-through to detailed reports. All the state is maintained
correctly so a drill through from one level to another works fine.
After the end-user has manipulated the reports (drill-throughs, date
range selection, etc.) we would like to make it so the end-user can
click on the menu that initially launched the page with the pair of
portlets and have state be just like when the portlet was first
launched. By default all of the request parameters and attributes that
control the state are maintained so clicking on the menu justs puts the
user back where they were rather than in the initial state.
I have tried using the PortletPreferences, setting up a preference
in the psml that has a name of "fromMenu" and a value of "true" and then
checking and resetting the preference in one of the portlets to another
value. Unfortunately clicking on the menu item for the psml page does
NOT set the preference back to a state of "true" so this method of
detecting a menu click doesn't work.
Since the initial request from the menu seems to start the portlet
in the render phase (doView) I have made all the urls within the two
portlets action urls and in the code to handle an action I set a flag
there which the render phase finds and knows that state should be
maintained. If the flag is not set the code assumes that request is
from a menu click and thus state needs to be reset to the initial
state. This seems to work fine except for one problem, a browser
refresh goes directly to the render phase so hitting refresh causes the
same reset of state that a menu request does.
I have also investigated looking at the referrer but that doesn't
seem to be of any help.
Essentially I would like a menu request to either reset the
portlets or for the portlets to be able to detect the request was from a
menu click so they can do the reset of state. Is there anyway to do this?
thanks,
Chris Marshall
Avenue100 Media Solutions
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: Detect Menu Click vs. Refresh or Portlet Url
Posted by David Sean Taylor <d....@onehippo.com>.
On Sat, Feb 13, 2010 at 8:21 AM, Christopher Marshall
<ch...@avenue100.com>wrote:
> We have a pair of portlets that use events and display BIRT reports with
> in Jetspeed that allow the end-user to select date ranges and drill-through
> to detailed reports. All the state is maintained correctly so a drill
> through from one level to another works fine. After the end-user has
> manipulated the reports (drill-throughs, date range selection, etc.) we
> would like to make it so the end-user can click on the menu that initially
> launched the page with the pair of portlets and have state be just like when
> the portlet was first launched. By default all of the request parameters
> and attributes that control the state are maintained so clicking on the menu
> justs puts the user back where they were rather than in the initial state.
> I have tried using the PortletPreferences, setting up a preference in
> the psml that has a name of "fromMenu" and a value of "true" and then
> checking and resetting the preference in one of the portlets to another
> value. Unfortunately clicking on the menu item for the psml page does NOT
> set the preference back to a state of "true" so this method of detecting a
> menu click doesn't work.
> Since the initial request from the menu seems to start the portlet in
> the render phase (doView) I have made all the urls within the two portlets
> action urls and in the code to handle an action I set a flag there which the
> render phase finds and knows that state should be maintained. If the flag
> is not set the code assumes that request is from a menu click and thus state
> needs to be reset to the initial state. This seems to work fine except for
> one problem, a browser refresh goes directly to the render phase so hitting
> refresh causes the same reset of state that a menu request does.
> I have also investigated looking at the referrer but that doesn't seem
> to be of any help.
>
> Essentially I would like a menu request to either reset the portlets or
> for the portlets to be able to detect the request was from a menu click so
> they can do the reset of state. Is there anyway to do this?
>
>From version 2.1.3 on, you can reset navigational state (window state and
render parameters), see instructions here:
https://issues.apache.org/jira/browse/JS2-806
(Does not include portlet preferences or portlet session state)
I was thinking we could more formerly define this kind of common container
events. 15.3 of the spec talks about WSRP predefined container events. I
would like to see portal (container) events that can be subscribed to, like
the 'page navigation' event described above. Any one else agree/disagree
container events would be an appropriate solution? Maybe we can put it to a
vote on the dev list, I'd be glad to look into it for the next release...