struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan Ara (JIRA)" <>
Subject [jira] Commented: (SHALE-188) Add a default outcome to the dialog manager
Date Thu, 08 Jun 2006 15:15:16 GMT
    [ ] 

Juan Ara commented on SHALE-188:

I already propose that long time ago.

Consider the following scenario:

I want to use Shale as the framework of my apps. (Unconditional premise ;) )
Most apps have a menu.
I don't want to keep both faces-config navigation rules and Shale navigation rules. I want
to use only Shale, as I was doing with Struts. Thus, keeping centralized my application config.
I want to have menu always visible and functional.

Result: (actual behaviour)
I cannot jump from a dialog to another (menu).

With default transitions mapped in subdialogs to an exit point, parent dialog (usually Main
dialog) will be the responsible of selecting those unknown transitions.
Each menu entry will start a new Subdialog which will have a default transition mapped to
it's exit point. Main dialog will be responsible for handling that kind of outcomes.

If you need a functional example, let me know.

We already have this aproach in a fully functional app, and it's working nicely. Also, programmes
don't feel strange with the dialog navigation rule and can handle entire application from
shale config files.

> Add a default outcome to the dialog manager
> -------------------------------------------
>          Key: SHALE-188
>          URL:
>      Project: Shale
>         Type: Improvement

>   Components: Core
>  Environment: Debian Linux - JDK 1.5
>     Reporter: Laure Goudon

> Version from manifest: Implementation-Version: 20060326
> Hello,
> When we click on the browser back button while in a dialog and then click on another
link or button, an Illegal argument exception comes (see stacktrace). This error occurs because
Shale can't find any transition for this action. It would be a good idea that we could have
a default transition (for instance named "*" or "default") that the dialog navigation handler
class would use if no other transition was found for this state or dialog.
> Thanks.
> stacktrace :
> java.lang.IllegalArgumentException: You have requested a transition outcome named "clusterMenu"
from a state named "viewApplicationView" in a dialog named "viewApplication", but no transition
definition can be found.  Double check the spelling of the transition outcome name.
> 	at org.apache.shale.dialog.faces.DialogNavigationHandler.transition(
> 	at org.apache.shale.dialog.faces.DialogNavigationHandler.postprocess(
> 	at org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(
> 	at org.apache.myfaces.application.ActionListenerImpl.processAction(
> 	at javax.faces.component.UICommand.broadcast(
> 	at org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem.broadcast(
> Proposed solution :
> In the class DialogNavigationHandler in the method transition
> 	/** Default outcome name constant as in :
> 	 *  <transition outcome="*" target="exit"/>
> 	 */
> 	public static final String DEFAULT_OUTCOME_NAME = "*";
>         // Identify the appropriate Transition
>         Transition transition = state.findTransition(outcome);
>         if (transition == null) {
>             transition = state.getDialog().findTransition(outcome);
> 	  // ---- Begin patch ----
> 	  // If not found, check the default outcome for the current state
>           if (transition == null) {
> 	     Transition transition = state.findTransition(outcome);
> 	     // If not found, check the default outcome for the current dialog.
> 	     if (transition == null) {
> 	       transition = state.getDialog().findTransition(DEFAULT_OUTCOME_NAME);
> 	     }
> 	  }
> 	  // ---- End patch ----
>         }
> 	if (transition == null) {
>             throw new IllegalArgumentException(messages.getMessage("dialog.noTransition",
>                                                new Object[] { outcome,
>                                                               state.getName(),
>                                                               state.getDialog().getName()
>         }

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message