Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319549

Summary: The OK button on the Add Filter Mappings Dialog is not enabled properly
Product: [WebTools] WTP Java EE Tools Reporter: Carl Anderson <ccc>
Component: jst.servletAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: david_williams
Version: 3.2Flags: david_williams: pmc_approved+
ccc: pmc_approved? (raghunathan.srinivasan)
ccc: pmc_approved? (naci.dai)
deboer: pmc_approved+
ccc: pmc_approved? (neil.hauge)
ccc: pmc_approved? (kaloyan)
cbridgha: review+
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
Update the state of the OK button when Servlet is selected. none

Description Carl Anderson CLA 2010-07-12 08:24:42 EDT
Steps to recreate:
1. Create a WEB 3.0 project with no DD
2. Add an annotated servlet
3. Open the New Filter wizard (right click on the project -> New -> Filter )
4. Type in the package and class name, click next
5. In the filter mappings section, click Add to add a new mapping. The Servlet checkbox is selected by default, and the OK button is enabled. 
6. Select the URL Pattern checkbox. The OK button is disabled because the url is empty
7. Select the Servlet checkbox again

Problem:
The OK button remains disabled and will stay disabled until you type something in the URL field. But if you double click on the servlet, the mapping is added despite the OK button being disabled.
Comment 1 Carl Anderson CLA 2010-07-12 08:26:17 EDT
Created attachment 174017 [details]
Update the state of the OK button when Servlet is selected.
Comment 2 Chuck Bridgham CLA 2010-07-12 13:33:30 EDT
approved
Comment 3 Carl Anderson CLA 2010-07-12 13:49:25 EDT
This bug prevents users from returning to the Servlet option of a Filter Mapping- the OK button was enabled when the dialog came up, but it will not re-enable if the user re-selects the Servlet radio button.
The workaround is to type something useless (but valid) in the URL Pattern text field and then select the Servlet radio button.  Alternately, users can press cancel and then bring the dialog back up.  Neither workaround is user-friendly.
Currently, the code only updates the enablement of the OK button when the URL Pattern radio button is selected.  I simply added the same check for enablement when the Servlet radio button is re-selected.  Chuck Bridgham has reviewed this change.
This change was tested by hand.
This is an extremely low risk change, limited to the OK button enablement of a sub-dialog of the Filter wizard.
Comment 4 Carl Anderson CLA 2010-07-13 11:01:57 EDT
Committed to HEAD for WTP 3.2.1 and WTP 3.3