You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2007/12/14 12:10:48 UTC

svn commit: r604163 - in /myfaces/tobago/trunk/sandbox/src/main: java/org/apache/myfaces/tobago/model/ java/org/apache/myfaces/tobago/taglib/sandbox/ resources/META-INF/

Author: lofwyr
Date: Fri Dec 14 03:10:47 2007
New Revision: 604163

URL: http://svn.apache.org/viewvc?rev=604163&view=rev
Log:
TOBAGO-518: some refactorings + cleanup

Modified:
    myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java
    myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java
    myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardStep.java
    myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/WizardTag.java
    myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-goto.xml
    myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-navigation.xml

Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java?rev=604163&r1=604162&r2=604163&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java Fri Dec 14 03:10:47 2007
@@ -17,13 +17,11 @@
  * limitations under the License.
  */
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.UICommand;
 
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIParameter;
 import javax.faces.event.ActionEvent;
 import java.util.ArrayList;
 import java.util.List;
@@ -65,6 +63,8 @@
 
   /**
    * @see Wizard#next()
+   * 
+   * @return The outcome after the method was executed
    */
   public final String next() {
     LOG.debug("next");
@@ -79,17 +79,13 @@
 
     }
 
-    // makeContentDecision(index);
-
-    // return getDefaultOutcome();
-
-    return getOutcome();
+    return getWizardStep(index).getOutcome();
   }
 
   /**
    * <p>
    * Hook for the implementation of business logic, after invoking the action
-   * {@link AbstractWizard#next()}.
+   * {@link org.apache.myfaces.tobago.model.AbstractWizardController#next()}.
    * If the execution of the business logic completed successfully, the method
    * has to return <i>true</i>. Otherwise the method has to return <i>false</i>.
    * </p>
@@ -103,22 +99,55 @@
     next();
   }
 
-  // TODO : javadoc
-  public void gotoStep(ActionEvent event) {
-    int step = Integer.parseInt((String) (event.getComponent().getAttributes().get("step")));
-    index = step;
+  /**
+   * @see Wizard#gotoStep(ActionEvent)
+   * 
+   * @param actionEvent
+   */
+  @SuppressWarnings("unchecked")
+  public void gotoStep(ActionEvent actionEvent) {
+    int step = -1;
+    try {
+      /* Default to get information about the requested index */
+      step = Integer.parseInt((String) (actionEvent.getComponent()
+          .getAttributes().get("step")));
+
+    } catch (RuntimeException lvException) {
+      LOG.warn("Unable to find attribute 'step'.", lvException);
+    }
+
+    if (step == -1) {
+      /* Try other way to get information about the requested index */
+      List<UIComponent> children = actionEvent.getComponent().getChildren();
+      for (UIComponent component : children) {
+        if (component instanceof UIParameter) {
+          UIParameter param = (UIParameter) component;
+          if (param.getName().equals("step")) {
+            step = (Byte) param.getValue();
+            break;
+          }
+        }
+        throw new RuntimeException("Didn't find step index.");
+      }
+    }
+
+    // index = step;
+    requestedIndex = step;
   }
 
   /**
    * @see Wizard#isNextAvailable()
+   * 
+   * @return True if the action next is available otherwise false
    */
   public final boolean isNextAvailable() {
-    // return (started && !preparedForFinishing);
     return !preparedForFinishing;
   }
 
   /**
    * @see Wizard#previous()
+   * 
+   * @return The outcome after the method was executed
    */
   public final String previous() {
     LOG.debug("previous");
@@ -126,39 +155,40 @@
     boolean success = doPrevious();
     if (success) {
 
-      if (index > 1) {
+      if (index > 0) {
         index--;
       }
 
-      // if (index == 0) {
-      // started = false;
-      // }
-
       if (preparedForFinishing) {
         preparedForFinishing = false;
       }
 
-      switch (backNavStrategy) {
-      case DELETE:
-        if (!sizeSet) {
-          size = index;
-        }
-        break;
-      default:
-        break;
-      }
+      applyBackwardNavigationStrategy();
+
     }
 
-    // makeContentDecision(index);
+    return getWizardStep(index).getOutcome();
+  }
 
-    return getOutcome();
-    // return getDefaultOutcome();
+  /**
+   * Applies backward navigation strategy principles
+   */
+  protected void applyBackwardNavigationStrategy() {
+    switch (backNavStrategy) {
+    case DELETE:
+      if (!sizeSet) {
+        size = index;
+      }
+      /* remove all wizard steps after the actual index */
+      course.subList(index + 1, course.size()).clear();
+      break;
+    }
   }
 
   /**
    * <p>
    * Hook for the implementation of business logic, after invoking the action
-   * {@link AbstractWizard#previous()}.
+   * {@link org.apache.myfaces.tobago.model.AbstractWizardController#previous()}.
    * If the execution of the business logic completed successfully, the method
    * has to return <i>true</i>. Otherwise the method has to return <i>false</i>.
    * </p>
@@ -174,6 +204,8 @@
 
   /**
    * @see Wizard#isPreviousAvailable()
+   * 
+   * @return True if the action previous is available otherwise false
    */
   public final boolean isPreviousAvailable() {
     return getIndex() > 0;
@@ -181,6 +213,8 @@
 
   /**
    * @see Wizard#isPreviousRendered()
+   * 
+   * @return True if the component is renderer otherwise false
    */
   public boolean isPreviousRendered() {
     return true;
@@ -188,6 +222,8 @@
 
   /**
    * @see Wizard#isBackwardNavigationImmediate()
+   * 
+   * @return True if backward navigation actions are immediate otherwise false
    */
   public boolean isBackwardNavigationImmediate() {
     return backNavImmediate;
@@ -196,8 +232,7 @@
   /**
    * Sets the indicator for immediate backward navigation.
    * 
-   * @param immediate
-   *          True if backward navigation is immediate, otherwise false
+   * @param immediate True if backward navigation is immediate, otherwise false
    */
   public void setBackwardNavigationImmediate(boolean immediate) {
     this.backNavImmediate = immediate;
@@ -212,6 +247,8 @@
 
   /**
    * @see Wizard#finish()
+   * 
+   * @return The outcome after the method was executed
    */
   public final String finish() {
     if (LOG.isDebugEnabled()) {
@@ -231,17 +268,19 @@
   /**
    * <p>
    * Hook for the implementation of business logic, after invoking the action
-   * {@link AbstractWizard#finish()}.
+   * {@link org.apache.myfaces.tobago.model.AbstractWizardController#finish()}.
    * If the execution of the business logic completed successfully, the method
    * has to return <i>true</i>. Otherwise the method has to return <i>false</i>.
    * </p>
    * 
-   * @return true if the method completed sucessfully, false if not
+   * @return True if the method completed sucessfully, false if not
    */
   protected abstract boolean doFinish();
 
   /**
    * @see Wizard#isFinishAvailable()
+   * 
+   * @return True if the action finish is available otherwise false
    */
   public final boolean isFinishAvailable() {
     return preparedForFinishing;
@@ -249,6 +288,8 @@
 
   /**
    * @see Wizard#cancel()
+   * 
+   * @return The outcome after the method was executed
    */
   public final String cancel() {
     if (LOG.isDebugEnabled()) {
@@ -266,7 +307,7 @@
   /**
    * <p>
    * Hook for the implementation of business logic, after invoking the action
-   * {@link AbstractWizard#cancel()}.
+   * {@link org.apache.myfaces.tobago.model.AbstractWizardController#cancel()}.
    * If the execution of the business logic completed successfully, the method
    * has to return <i>true</i>. Otherwise the method has to return <i>false</i>.
    * </p>
@@ -275,29 +316,31 @@
    */
   protected abstract boolean doCancel();
 
-  /**
-   * @see Wizard#gotoClicked(ActionEvent)
-   */
-  public final void gotoClicked(ActionEvent actionEvent) {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("gotoClicked");
-    }
-    UICommand command = (UICommand) actionEvent.getComponent();
-    String id = command.getId();
-    String stepIndex = StringUtils.difference("wizard-goto-", id);
-    try {
-      LOG.info("Goto step " + stepIndex);
-      requestedIndex = Integer.valueOf(stepIndex);
-    } catch (NumberFormatException lvException) {
-      FacesContext.getCurrentInstance().addMessage(
-          "",
-          new FacesMessage(FacesMessage.SEVERITY_ERROR, null,
-              "Step index unknown: " + stepIndex));
-    }
-  }
+  // /**
+  // * @see Wizard#gotoClicked(ActionEvent)
+  // */
+  // public final void gotoClicked(ActionEvent actionEvent) {
+  // if (LOG.isDebugEnabled()) {
+  // LOG.debug("gotoClicked");
+  // }
+  // UICommand command = (UICommand) actionEvent.getComponent();
+  // String id = command.getId();
+  // String stepIndex = StringUtils.difference("wizard-goto-", id);
+  // try {
+  // LOG.info("Goto step " + stepIndex);
+  // requestedIndex = Integer.valueOf(stepIndex);
+  // } catch (NumberFormatException lvException) {
+  // FacesContext.getCurrentInstance().addMessage(
+  // "",
+  // new FacesMessage(FacesMessage.SEVERITY_ERROR, null,
+  // "Step index unknown: " + stepIndex));
+  // }
+  // }
 
   /**
    * @see Wizard#gotoStep()
+   * 
+   * @return The outcome after the method was executed
    */
   public final String gotoStep() {
     LOG.debug("gotoStep: " + requestedIndex);
@@ -307,28 +350,28 @@
       preparedForFinishing = false;
       index = requestedIndex;
 
-      switch (backNavStrategy) {
-      case DELETE:
-        if (!isSizeSet()) {
-          size = index;
-        }
-        break;
-      default:
-        break;
-      }
+      applyBackwardNavigationStrategy();
+
+      // switch (backNavStrategy) {
+      // case DELETE:
+      // if (!isSizeSet()) {
+      // size = index;
+      // }
+      // break;
+      // }
     }
 
     // makeContentDecision(index);
     // reset requestIndex
-    requestedIndex = 0;
+    requestedIndex = -1;
     // return getDefaultOutcome();
-    return getOutcome();
+    return getWizardStep(index).getOutcome();
   }
 
   /**
    * <p>
    * Hook for the implementation of business logic, after invoking the action
-   * {@link AbstractWizard#gotoStep()}.
+   * {@link org.apache.myfaces.tobago.model.AbstractWizardController#gotoStep()}.
    * If the execution of the business logic completed successfully, the method
    * has to return <i>true</i>. Otherwise the method has to return <i>false</i>.
    * </p>
@@ -338,8 +381,7 @@
    * the business logic returned <i>false</i>.
    * </p>
    * 
-   * @param indexToShow
-   *          The view index to show next
+   * @param indexToShow The view index to show next
    * @return true if the method completed sucessfully, false if not
    */
   protected abstract boolean doGotoStep(int indexToShow);
@@ -363,6 +405,8 @@
 
   /**
    * @see Wizard#getSize()
+   * 
+   * @return The size (number) of views in the wizard
    */
   public final int getSize() {
     return size;
@@ -379,10 +423,8 @@
    * Sets the size (number) of the wizards views and a flag indicating that the
    * set/configured size has to be reset.
    * 
-   * @param size
-   *          The number of the wizards views
-   * @param reset
-   *          Flag indication if the already size set, has to be reset
+   * @param size The number of the wizards views
+   * @param reset Flag indication if the already size set, has to be reset
    */
   public final void setSize(int size, boolean reset) {
     if (reset) {
@@ -404,7 +446,7 @@
    */
   protected void reset() {
     preparedForFinishing = false;
-    requestedIndex = 0;
+    requestedIndex = -1;
     index = 0;
     if (!sizeSet) {
       size = 0;
@@ -413,7 +455,11 @@
   }
 
   /**
-   * @see Wizard#getDefaultOutcome()
+   * Returns the outcome after the wizard stand actions where executed, which
+   * will not leave the wizards view Id (except in case of errors).
+   * 
+   * @return The outcome after the wizard actions where executed, except actions
+   *         which leave the view (viewId) where the wizard is shown
    */
   public final String getDefaultOutcome() {
     return defaultOutcome;
@@ -423,8 +469,7 @@
    * Sets the outcome after the wizard stand actions where executed, which will
    * not leave the wizards view Id (except in case of errors).
    * 
-   * @param defaultOutcome
-   *          The outcome of the wizards standard actions
+   * @param defaultOutcome The outcome of the wizards standard actions
    */
   public final void setDefaultOutcome(String defaultOutcome) {
     this.defaultOutcome = defaultOutcome;
@@ -462,8 +507,7 @@
    * will be applied.
    * </p>
    * 
-   * @param strategy
-   *          The strategy to use for backward navigation
+   * @param strategy The strategy to use for backward navigation
    */
   public final void setBackwardNavigationStrategy(String strategy) {
     try {
@@ -486,14 +530,45 @@
   }
 
   /**
-   * @see Wizard#registerOutcome(String, String)
+   * Registers a wizard step at the actual wizard index.
+   * 
+   * @param outcome The outcome of the wizard step
+   * @param title The title of the wizard step
+   */
+  public void registerWizardStep(String outcome, String title) {
+    registerWizardStep(index, outcome, title);
+    // if (index == course.size()) { // this is a new page
+    // course.add(createWizardStep(outcome, title));
+    // } else if (index < course.size()) {
+    // course.set(index, createWizardStep(outcome, title));
+    // } else {
+    // throw new IllegalStateException("Index too large for course: index="
+    // + index + " course.size()=" + course.size());
+    // }
+    // LOG.info("course: " + course);
+  }
+
+  /**
+   * Creates a new {@link WizardStep} instance.
+   * 
+   * @param index The index of the wizard step
+   * @param outcome The outcome for the wizard step
+   * @param title The title of the wizard step
+   * @return A {@link WizardStep} instance
+   */
+  protected WizardStep createWizardStep(int index, String outcome, String title) {
+    return new WizardStep(index, outcome, title);
+  }
+
+  /**
+   * @see Wizard#registerWizardStep(int, String, String)
    */
-  public void registerOutcome(String outcome, String title) {
+  public final void registerWizardStep(int index, String outcome, String title) {
 
     if (index == course.size()) { // this is a new page
-      course.add(createWizardStep(outcome, title));
-    } else if (index < course.size()) {
-      course.set(index, createWizardStep(outcome, title));
+      course.add(createWizardStep(index, outcome, title));
+    } else if (index < course.size()) { // a page at the index already exists
+      course.set(index, createWizardStep(index, outcome, title)); // replace
     } else {
       throw new IllegalStateException("Index too large for course: index="
           + index + " course.size()=" + course.size());
@@ -501,26 +576,33 @@
     LOG.info("course: " + course);
   }
 
-  protected WizardStep createWizardStep(String outcome, String title) {
-    return new WizardStep(outcome, title, index);
-  }
-
-  public void registerOutcome(String outcome, String title, int index) {
+  // /**
+  // * Returns the outcome for the requested wizard view
+  // *
+  // * @return The outcome for the view index
+  // */
+  // private String getOutcome() {
+  // return course.get(index).getOutcome();
+  // }
 
-    if (index == course.size()) { // this is a new page
-      course.add(new WizardStep(outcome, title, index));
-    } else {
-      registerOutcome(outcome, title);
-    }
-  }
+  // /**
+  // * Returns the outcome for the requested wizard view
+  // *
+  // * @param forIndex The index of the requested wizard view
+  // * @return The outcome for the view index
+  // */
+  // public final String getOutcome(int forIndex) {
+  // return course.get(forIndex).getOutcome();
+  // }
 
   /**
-   * Returns the outcome for the requested wizard view
+   * Returns the registered {@link WizardStep} at the specified index
    * 
-   * @return The outcome for the view index
+   * @param forIndex The index of the requested wizard view
+   * @return The registered {@link WizardStep} instance at the specified index
    */
-  private String getOutcome() {
-    return course.get(index).getOutcome();
+  public final WizardStep getWizardStep(int forIndex) {
+    return course.get(forIndex);
   }
 
 }

Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java?rev=604163&r1=604162&r2=604163&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java Fri Dec 14 03:10:47 2007
@@ -52,8 +52,7 @@
    * Sets the number (size) of views of the wizard. The size should be set only
    * once, e.g. during initialization.
    * 
-   * @param size
-   *          The number of views of the wizard
+   * @param size The number of views of the wizard
    */
   void setSize(int size);
 
@@ -98,7 +97,7 @@
    * Indicator, if backward navigation actions are immediate. The indicator
    * should be set only once, e.g. during initialization.
    * 
-   * @return If backward navigation actions are immediate
+   * @return True if backward navigation actions are immediate otherwise false
    */
   boolean isBackwardNavigationImmediate();
 
@@ -138,7 +137,7 @@
    * 
    * @param actionEvent
    */
-  void gotoClicked(ActionEvent actionEvent);
+  void gotoStep(ActionEvent actionEvent);
 
   /**
    * Managed bean (controller) method to execute to navigate between the wizards
@@ -149,23 +148,26 @@
   String gotoStep();
 
   /**
-   * Returns the outcome after the wizard stand actions where executed, which
-   * will not leave the wizards view Id (except in case of errors).
+   * Sets the strategy to use for backward navigation
    * 
-   * @return The outcome after the wizard actions where executed, except actions
-   *         which leave the view (viewId) where the wizard is shown
+   * @param strategy The strategy to use for backward navigation
    */
-  String getDefaultOutcome();
+  void setBackwardNavigationStrategy(String strategy);
 
   /**
-   * Sets the strategy to use for backward navigation
+   * Returns the course (progression) of {@link WizardStep}s. The progression
+   * is stored in the order of the wizard steps where added to the list.
    * 
-   * @param strategy
-   *          The strategy to use for backward navigation
+   * @return The List of {@link WizardStep}s
    */
-  void setBackwardNavigationStrategy(String strategy);
-
   List<WizardStep> getCourse();
 
-  void registerOutcome(String outcome, String title);
+  /**
+   * Registers a wizard step.
+   * 
+   * @param index The index of the wizard step
+   * @param outcome The outcome of the wizard step
+   * @param title The title of the wizard step
+   */
+  void registerWizardStep(int index, String outcome, String title);
 }

Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardStep.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardStep.java?rev=604163&r1=604162&r2=604163&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardStep.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardStep.java Fri Dec 14 03:10:47 2007
@@ -16,16 +16,34 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+/**
+ * This class stores information about one view (or step) in a wizard.
+ */
 public class WizardStep {
 
   private String outcome;
   private String title;
   private int index;
 
-  public WizardStep(String outcome, String title, int index) {
+  /**
+   * Create a new {@link WizardStep} instance, with information about an
+   * specific view.
+   * 
+   * @param index The index of the view
+   * @param outcome The outcome of the view
+   * @param title The title of the view
+   */
+  public WizardStep(int index, String outcome, String title) {
+    this.index = index;
     this.outcome = outcome;
     this.title = title;
-    this.index = index;
+  }
+
+  @Override
+  public String toString() {
+    return "Index: " + index + ", title '" + title + "', outcome '" + outcome
+        + "'";
   }
 
   public String getOutcome() {

Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/WizardTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/WizardTag.java?rev=604163&r1=604162&r2=604163&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/WizardTag.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/WizardTag.java Fri Dec 14 03:10:47 2007
@@ -17,10 +17,8 @@
  * limitations under the License.
  */
 
-import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
 import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
@@ -61,11 +59,9 @@
     panelTag = new PanelTag();
     panelTag.setPageContext(pageContext);
     panelTag.setParent(getParent());
-/* todo
-    if (rendered != null) {
-      panelTag.setRendered(rendered);
-    }
-*/
+    /*
+     * todo if (rendered != null) { panelTag.setRendered(rendered); }
+     */
     panelTag.doStartTag();
 
     FacetTag facetTag = new FacetTag();
@@ -92,9 +88,10 @@
 
     List<WizardStep> course = null;
     try {
-      Object bean = VariableResolverUtil.resolveVariable(FacesContext.getCurrentInstance(), "controller");
+      Object bean = VariableResolverUtil.resolveVariable(FacesContext
+          .getCurrentInstance(), "controller");
       Wizard wizard = (Wizard) PropertyUtils.getProperty(bean, "wizard");
-      wizard.registerOutcome(outcome, title);
+      wizard.registerWizardStep(wizard.getIndex(), outcome, title);
       course = wizard.getCourse();
     } catch (Exception e) {
       LOG.error("", e);
@@ -113,7 +110,7 @@
 
     GridLayoutTag gridLayoutTag = new GridLayoutTag();
     gridLayoutTag.setPageContext(pageContext);
-//    gridLayoutTag.setColumns("*");
+    // gridLayoutTag.setColumns("*");
     StringBuilder columns = new StringBuilder();
     for (WizardStep info : course) {
       columns.append("fixed;");
@@ -179,21 +176,21 @@
 
     cell(panelTag);
 
-/*
-    WizardControllerTag controllerTag = new WizardControllerTag();
-    controllerTag.setPageContext(pageContext);
-    controllerTag.setParent(panelTag);
-    controllerTag.setController(controller);
-    controllerTag.doStartTag();
-    controllerTag.doEndTag();
-*/
+    /*
+     * WizardControllerTag controllerTag = new WizardControllerTag();
+     * controllerTag.setPageContext(pageContext);
+     * controllerTag.setParent(panelTag);
+     * controllerTag.setController(controller); controllerTag.doStartTag();
+     * controllerTag.doEndTag();
+     */
 
     ButtonTag previousTag = new ButtonTag();
     previousTag.setPageContext(pageContext);
     previousTag.setParent(panelTag);
     previousTag.setLabel("Previous");
     previousTag.setAction(controller.replace("}", ".previous}"));
-    previousTag.setDisabled(controller.replace("}", ".previousAvailable}").replace("#{", "#{!"));
+    previousTag.setDisabled(controller.replace("}", ".previousAvailable}")
+        .replace("#{", "#{!"));
     previousTag.doStartTag();
     previousTag.doEndTag();
 
@@ -203,7 +200,8 @@
     nextTag.setLabel("Next");
     nextTag.setAction(next);
     nextTag.setActionListener(controller.replace("}", ".next}"));
-    nextTag.setDisabled(controller.replace("}", ".nextAvailable}").replace("#{", "#{!"));
+    nextTag.setDisabled(controller.replace("}", ".nextAvailable}").replace(
+        "#{", "#{!"));
     nextTag.doStartTag();
     nextTag.doEndTag();
 
@@ -212,7 +210,8 @@
     finish.setParent(panelTag);
     finish.setLabel("Finish");
     finish.setAction(controller.replace("}", ".finish}"));
-    finish.setDisabled(controller.replace("}", ".finishAvailable}").replace("#{", "#{!"));
+    finish.setDisabled(controller.replace("}", ".finishAvailable}").replace(
+        "#{", "#{!"));
     finish.doStartTag();
     finish.doEndTag();
 

Modified: myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-goto.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-goto.xml?rev=604163&r1=604162&r2=604163&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-goto.xml (original)
+++ myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-goto.xml Fri Dec 14 03:10:47 2007
@@ -25,51 +25,54 @@
 	<c:if test="${empty gotoSource}" >
 		<c:set var="replaceGoto" value="false" />
 	</c:if>	
-	
-	<c:choose>
+	
+	<c:choose>
 		<!-- replace goto -->
 		<c:when test="${replaceGoto}">
 			<ui:include src="${gotoSource}" />
 		</c:when>
 		<!-- default goto -->
-		<c:otherwise>
-		
+		<c:otherwise>
+		
 			<!-- layout information -->
-			<c:set var="colums" value="" />
-			<c:forEach var="index" begin="1" end="${controller.size}" step="1">
-				<c:if test="${index ne 1}">
-					<c:set var="colums" value="${colums};fixed" />
+			<c:set var="columns" value="fixed" />
+			<c:forEach var="i" begin="0" end="${controller.size}" step="1">
+				<c:if test="${i > 0}">
+					<c:set var="columns" value="${columns};fixed;fixed" />
 				</c:if>
-				<c:set var="colums" value="${colums};fixed" />
 			</c:forEach>
-			<c:set var="colums" value="${colums};*" />
+			<c:set var="columns" value="${columns};*" />
 			
 			<!-- navigation -->
 			<tc:panel>
 				<f:facet name="layout">
-					<tc:gridLayout rows="fixed" columns="${colums}" />
+					<tc:gridLayout rows="fixed" columns="${columns}" />
 				</f:facet>
 			
-				<c:forEach var="index" begin="1" end="${controller.size}" step="1">
-					<c:if test="${index ne 1}">
+				<c:forEach var="index" begin="0" end="${controller.size}" step="1">
+					<c:if test="${index > 0}">
 						<tc:out value=">>" />
 					</c:if>
 					<c:set var="isButtonDisabled" value="false" />
-					<c:if test="${(i gt controller.index) or (controller.backwardNavigationStrategy eq 'notallowed')}">
+					<c:if test="${(i > controller.index) or (controller.backwardNavigationStrategy == 'notallowed')}">
 						<c:set var="isButtonDisabled" value="true" />
 					</c:if>
 					<tc:button action="${controller.gotoStep}"
-						actionListener="${controller.gotoClicked}"
+						actionListener="${controller.gotoStep}"
 						disabled="${isButtonDisabled}"
 						immediate="${controller.backwardNavigationImmediate}"
-						label="${index}"
-						id="wizard-goto-${index}" />
+						label="${index + 1}">
+						<!--
+						<tc:attribute name="step" value="${index}" />
+						-->
+						<f:param name="step" value="${index}" />
+					</tc:button>
 				</c:forEach>
 			
 				<tc:cell />
 			
 			</tc:panel>
-		</c:otherwise>
+		</c:otherwise>
 	</c:choose>
 
 </ui:composition>

Modified: myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-navigation.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-navigation.xml?rev=604163&r1=604162&r2=604163&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-navigation.xml (original)
+++ myfaces/tobago/trunk/sandbox/src/main/resources/META-INF/wizard-navigation.xml Fri Dec 14 03:10:47 2007
@@ -29,7 +29,7 @@
 	<c:if test="${empty isPreviousRendered}">
 		<c:set var="isPreviousRendered" value="true" />
 	</c:if>
-	
+	
 	<c:choose>
 		<!-- replace navigation -->
 		<c:when test="${replaceNavigation}" >
@@ -43,7 +43,7 @@
 					<tc:gridLayout columns="*;fixed;fixed;fixed;fixed" />
 				</f:facet>
 				
-				<c:if test="${!controller.previousAvailable or (controller.backwardNavigationStrategy eq 'notallowed')}" >
+				<c:if test="${!controller.previousAvailable or (controller.backwardNavigationStrategy == 'notallowed')}" >
 					<c:set var="previousDisabled" value="true" />
 				</c:if>
 			
@@ -64,7 +64,7 @@
 					immediate="true" />
 			
 			</tc:panel>
-		</c:otherwise>
+		</c:otherwise>
 	</c:choose>
 
 </ui:composition>