[ 
https://issues.apache.org/jira/browse/WICKET-2063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668960#action_12668960
 ] 

Jeremy Thomerson commented on WICKET-2063:
------------------------------------------

Here are some more details about those two phases:

When you click to go from the first step to the second, this is the stack trace 
where the cached isEnabled flag is first calculated (incorrectly - before step 
has advanced)

Thread [btpool0-3] (Suspended)  
        PreviousButton(Component).isEnabledInHierarchy() line: 4386     
        Form$21(Form$ValidationVisitor).formComponent(IFormVisitorParticipant) 
line: 165        
        FormComponent<T>.visitFormComponentsPostOrderHelper(Component, 
FormComponent$IVisitor) line: 415        
        FormComponent<T>.visitFormComponentsPostOrderHelper(Component, 
FormComponent$IVisitor) line: 402        
        FormComponent<T>.visitFormComponentsPostOrderHelper(Component, 
FormComponent$IVisitor) line: 402        
        FormComponent<T>.visitFormComponentsPostOrder(Component, 
FormComponent$IVisitor) line: 374      
        Form<T>.visitFormComponentsPostOrder(FormComponent$IVisitor) line: 1158 
        Form<T>.validateComponents() line: 2013 
        Form<T>.validate() line: 1993   
        Form<T>.process() line: 937     
        Form<T>.process(IFormSubmittingComponent) line: 908     
        Form<T>.onFormSubmitted() line: 876     
        NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
available [native method]  
        NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available   
        DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not 
available       
        Method.invoke(Object, Object...) line: not available    
        RequestListenerInterface.invoke(Page, Component) line: 182      
        ListenerInterfaceRequestTarget.processEvents(RequestCycle) line: 73     
        
WebRequestCycleProcessor(AbstractRequestCycleProcessor).processEvents(RequestCycle)
 line: 91    
        WebRequestCycle(RequestCycle).processEventsAndRespond() line: 1192      
        WebRequestCycle(RequestCycle).step() line: 1271 
        WebRequestCycle(RequestCycle).steps() line: 1370        
        WebRequestCycle(RequestCycle).request() line: 501       
        WicketFilter.doGet(HttpServletRequest, HttpServletResponse) line: 455   
        WicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) 
line: 288   
        ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse) 
line: 1084 
        ServletHandler.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 360   
        SecurityHandler.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 216  
        SessionHandler.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 181   
        WebAppContext(ContextHandler).handle(String, HttpServletRequest, 
HttpServletResponse, int) line: 712    
        WebAppContext.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 405    
        Server(HandlerWrapper).handle(String, HttpServletRequest, 
HttpServletResponse, int) line: 139   
        Server.handle(HttpConnection) line: 313 
        HttpConnection.handleRequest() line: 506        
        HttpConnection$RequestHandler.content(Buffer) line: 844 
        HttpParser.parseNext() line: 644        
        HttpParser.parseAvailable() line: 211   
        HttpConnection.handle() line: 381       
        SocketConnector$Connection.run() line: 227      
        BoundedThreadPool$PoolThread.run() line: 442    


After adding my patch, this is where it's calculated correctly for the second 
time (after the step has advanced)

Thread [btpool0-3] (Suspended)  
        PreviousButton(Component).isEnabledInHierarchy() line: 4386     
        PreviousButton(FormComponent<T>).onComponentTag(ComponentTag) line: 
1461        
        PreviousButton(Button).onComponentTag(ComponentTag) line: 198   
        PreviousButton(Component).renderComponent(MarkupStream) line: 2523      
        PreviousButton(MarkupContainer).onRender(MarkupStream) line: 1521       
        PreviousButton(Component).render(MarkupStream) line: 2377       
        WizardButtonBar(MarkupContainer).renderNext(MarkupStream) line: 1399    
        WizardButtonBar(MarkupContainer).renderComponentTagBody(MarkupStream, 
ComponentTag) line: 1586  
        WizardButtonBar(MarkupContainer).renderAssociatedMarkup(String, String) 
line: 668       
        WizardButtonBar(Panel).onComponentTagBody(MarkupStream, ComponentTag) 
line: 114 
        WizardButtonBar(Component).renderComponent(MarkupStream) line: 2552     
        WizardButtonBar(MarkupContainer).onRender(MarkupStream) line: 1521      
        WizardButtonBar(Component).render(MarkupStream) line: 2377      
        Form<T>(MarkupContainer).renderNext(MarkupStream) line: 1399    
        Form<T>(MarkupContainer).renderComponentTagBody(MarkupStream, 
ComponentTag) line: 1586  
        Form<T>(MarkupContainer).onComponentTagBody(MarkupStream, ComponentTag) 
line: 1510      
        Form<T>.onComponentTagBody(MarkupStream, ComponentTag) line: 1845       
        Form<T>(Component).renderComponent(MarkupStream) line: 2552     
        Form<T>(MarkupContainer).onRender(MarkupStream) line: 1521      
        Form<T>.onRender(MarkupStream) line: 1916       
        Form<T>(Component).render(MarkupStream) line: 2377      
        StaticWizard(MarkupContainer).renderNext(MarkupStream) line: 1399       
        StaticWizard(MarkupContainer).renderComponentTagBody(MarkupStream, 
ComponentTag) line: 1586     
        StaticWizard(MarkupContainer).renderAssociatedMarkup(String, String) 
line: 668  
        StaticWizard(Panel).onComponentTagBody(MarkupStream, ComponentTag) 
line: 114    
        StaticWizard(Component).renderComponent(MarkupStream) line: 2552        
        StaticWizard(MarkupContainer).onRender(MarkupStream) line: 1521 
        StaticWizard(Component).render(MarkupStream) line: 2377 
        WizardPage(MarkupContainer).renderNext(MarkupStream) line: 1399 
        WizardPage(MarkupContainer).renderAll(MarkupStream) line: 1537  
        WizardPage(Page).onRender(MarkupStream) line: 1515      
        WizardPage(Component).render(MarkupStream) line: 2377   
        WizardPage(Page).renderPage() line: 919 
        WebRequestCycle.redirectTo(Page) line: 166      
        ListenerInterfaceRequestTarget(PageRequestTarget).respond(RequestCycle) 
line: 58        
        
WebRequestCycleProcessor(AbstractRequestCycleProcessor).respond(RequestCycle) 
line: 104 
        WebRequestCycle(RequestCycle).processEventsAndRespond() line: 1200      
        WebRequestCycle(RequestCycle).step() line: 1271 
        WebRequestCycle(RequestCycle).steps() line: 1370        
        WebRequestCycle(RequestCycle).request() line: 501       
        WicketFilter.doGet(HttpServletRequest, HttpServletResponse) line: 455   
        WicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) 
line: 288   
        ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse) 
line: 1084 
        ServletHandler.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 360   
        SecurityHandler.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 216  
        SessionHandler.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 181   
        WebAppContext(ContextHandler).handle(String, HttpServletRequest, 
HttpServletResponse, int) line: 712    
        WebAppContext.handle(String, HttpServletRequest, HttpServletResponse, 
int) line: 405    
        Server(HandlerWrapper).handle(String, HttpServletRequest, 
HttpServletResponse, int) line: 139   
        Server.handle(HttpConnection) line: 313 
        HttpConnection.handleRequest() line: 506        
        HttpConnection$RequestHandler.content(Buffer) line: 844 
        HttpParser.parseNext() line: 644        
        HttpParser.parseAvailable() line: 211   
        HttpConnection.handle() line: 381       
        SocketConnector$Connection.run() line: 227      
        BoundedThreadPool$PoolThread.run() line: 442    


> Wizard buttons (previous / finish) aren't enabled when they should be
> ---------------------------------------------------------------------
>
>                 Key: WICKET-2063
>                 URL: https://issues.apache.org/jira/browse/WICKET-2063
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.4-RC2
>            Reporter: Jeremy Thomerson
>             Fix For: 1.4-RC2
>
>         Attachments: 2063.patch
>
>
> When using the Wizard component in 1.4-SNAPSHOT (sometime after 1.4-RC1), the 
> previous and finish buttons don't enable when they should.  I have found that 
> this is because isEnabledInHierarchy is called multiple times, with the first 
> time being during the POST process, before the wizard step is advanced to the 
> next step.  Since the step has not advanced when isEnabled is calculated, you 
> get the following behavior:
> 1 - click "next" from first step to second - the "previous" button should be 
> enabled, but it's not
> 2 - the "finish" button never is enabled, even on the last step

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to