This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new bb0c56d  ensure wizard.currentStep is in the right state when 
showContent
bb0c56d is described below

commit bb0c56dff6ef0e4dcc7947538e26e43ec523e1a9
Author: Carlos Rovira <[email protected]>
AuthorDate: Sun Dec 2 19:01:27 2018 +0100

    ensure wizard.currentStep is in the right state when showContent
---
 .../main/royale/org/apache/royale/jewel/Wizard.as  | 30 ++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Wizard.as 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Wizard.as
index 65a2179..8e3b3ae 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Wizard.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Wizard.as
@@ -77,9 +77,35 @@ package org.apache.royale.jewel
             typeNames = "jewel wizard";
                }
 
-               public function showPage(id:String):void
+               /**
+                * show a page by id, but does not update currentStep
+                * 
+                * @param steName, that is the "id" of the content (the 
WizardPage) to activate
+                * 
+                * @see org.apache.royale.jewel.WizardContent.showContent
+                */
+               public function showPage(stepName:String):void
+               {
+                       if(currentStep.name != stepName)
+                       {
+                               currentStep = findStepByName(stepName);
+                       }
+                       content.showContent(currentStep.name);
+               }
+
+               public function findStepByName(name:String):WizardStep
                {
-                       content.showContent(id);
+                       var n:int = numElements;
+            for (var i:int = 0; i < n; i++)
+            {
+                var page:WizardPage = getElementAt(i) as WizardPage;
+                if(page.step.name == name)
+                {
+                    return page.step;
+                }
+            }
+            
+            return null;
                }
 
                /**

Reply via email to