Closed
Bug 73049
Opened 25 years ago
Closed 24 years ago
ValidateNumberString should show error message if user input string is empty
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
mozilla0.9.5
People
(Reporter: cmanske, Assigned: cmanske)
Details
Attachments
(9 files)
5.55 KB,
patch
|
Details | Diff | Splinter Review | |
5.57 KB,
patch
|
Details | Diff | Splinter Review | |
9.28 KB,
patch
|
Details | Diff | Splinter Review | |
12.26 KB,
patch
|
Details | Diff | Splinter Review | |
12.35 KB,
patch
|
Details | Diff | Splinter Review | |
13.41 KB,
patch
|
Details | Diff | Splinter Review | |
13.38 KB,
patch
|
Details | Diff | Splinter Review | |
15.29 KB,
patch
|
Details | Diff | Splinter Review | |
15.91 KB,
patch
|
Details | Diff | Splinter Review |
We use the JS method ValidateNumberString(value, minValue, maxValue)
to detect when a user enters a number outside of allowable range, but if the
input string ("value") is empty, we don't show the error dialog.
We should simply show the error dialog with a similar message as we do now.
Updated•25 years ago
|
OS: Windows NT → All
![]() |
Assignee | |
Comment 1•25 years ago
|
||
![]() |
Assignee | |
Comment 2•25 years ago
|
||
A bit more involved than I hoped.
I turns out that the only case where we really want to force the input to
have a value is for "row" and "columns" in table dialogs. This fix is general
in case there's some other users in the future.
Status: NEW → ASSIGNED
Whiteboard: FIX IN HAND need r=, sr=
Target Milestone: --- → mozilla0.9
![]() |
Assignee | |
Comment 3•25 years ago
|
||
Comment 4•25 years ago
|
||
Why does EdTableProps.js have a function "ValidateNumber" but no other property
dialogs do? Other dialogs (as well as EdTableProps.js) seem to call
ValidateNumberString in EdDialogCommon.js.
Why haven't you propagated the additional parameter in ValidateNumberString to
all callers? Have you checked every usage of ValidateNumberString to be sure
that we aren't requiring any of those values?
![]() |
Assignee | |
Comment 5•25 years ago
|
||
>Why does EdTableProps.js have a function "ValidateNumber"...?
Simple factoring. No other dialog needed the complicated code that table
attributes require because of "%" vs. pixels issues, etc.
> Why haven't you propagated the additional parameter in ValidateNumberString?
Default (missing = "null) parameters are OK in JS.
>Have you checked every usage...
Yes.
It turned out only the "row" and "column" that needed the new param to be
"true".
Comment 6•25 years ago
|
||
>>Why does EdTableProps.js have a function "ValidateNumber"...?
>Simple factoring. No other dialog needed the complicated code that table
>attributes require because of "%" vs. pixels issues, etc.
Other dialogs do have % vs pixels; why is this different? Why is ValidateNumber
function in table js rather than the common/shared dialog JS file?
I'm aware of the defaults for JS, just making sure that you are intentionally
doing that. I'm glad that no other dialogs rely on this new parameter.
![]() |
Assignee | |
Comment 7•25 years ago
|
||
![]() |
Assignee | |
Comment 8•25 years ago
|
||
Latest patch includes change to ValidateNumber input param: input widget passed
in instead of its ID for consistency with 2nd parameter ("listWidget").
ValidateNumber() may be used by Horizontal Rule and Image Dialogs -- file
separate bugs if we want to do that.
![]() |
Assignee | |
Comment 10•25 years ago
|
||
![]() |
Assignee | |
Comment 12•25 years ago
|
||
![]() |
Assignee | |
Comment 13•25 years ago
|
||
![]() |
Assignee | |
Comment 14•25 years ago
|
||
![]() |
Assignee | |
Comment 15•25 years ago
|
||
![]() |
Assignee | |
Comment 16•25 years ago
|
||
Brade: latest patch should clear up problems you found in your previous testing.
Keywords: patch
![]() |
Assignee | |
Comment 17•25 years ago
|
||
Comment 18•25 years ago
|
||
r=brade
![]() |
Assignee | |
Comment 19•25 years ago
|
||
Need just sr now.
Whiteboard: FIX IN HAND need r=, sr= → FIX IN HAND need sr=
Comment 20•25 years ago
|
||
Please rename 'error' to gError if it really is global, or rewrite the code to
not require a global at all. 'error' is way too prone to name conflicts for a
global variable. An alternative way to pass back this error condition would be to
throw an exception, which might make the code cleaner.
Also, will this kind of validation still work when we change to using key
listeners which can grab keypresses before they get to the input field?
Fix 'error' and sr=sfraser
![]() |
Assignee | |
Comment 21•25 years ago
|
||
Ok, I've changed "error" to "gValidationError" for clarity.
This validation is called separately from the "filter"
validation that happens on typing inside an edit field, so it will have
no effect on future changes to that.
![]() |
Assignee | |
Comment 22•25 years ago
|
||
Removing keywords since reviews are finished
![]() |
Assignee | |
Comment 23•25 years ago
|
||
checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Whiteboard: FIX IN HAND
![]() |
||
Comment 24•24 years ago
|
||
currently if you have no value for row and column, the OK
button is dimmed out...so the user won't see any error panel
pop up...is this what this bug is all about?
![]() |
||
Comment 25•24 years ago
|
||
In the 9-06 Build:
1. create a table with 2 rows, 2 columns
2. right click on the table and select properties
3. change the row and columns number to 0
RESULT: Receive error: "The number you entered (0) is outside the allowed range.
Please enter a number between 1-1000."
1. create a table with 2 rows, 2 columns
2. right click on the table and select properties
3. change the row and columns number to null
RESULT: I get a message informing me that: "Reducing the number of rows or
columns will delete table cells and their contents. Do you really want to do
this?" If I click "Delete Cells" on this the table, and it's contents are deleted.
Is this the correct behavior, should I see the first error message in both
instances, or as Sujay pointed out - should the OK button be greyed out (like it
is when you atempt to create a table with no value for rows or columns)?
Comment 26•24 years ago
|
||
reopen bug based on previous comments
First example is correct behavior.
Second example (no data in edit fields) is wrong.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla0.9 → mozilla0.9.5
![]() |
Assignee | |
Comment 27•24 years ago
|
||
I think we should have opened a new bug on the specific issue noted.
Status: REOPENED → ASSIGNED
![]() |
||
Comment 28•24 years ago
|
||
Closing this bug, opening http://bugzilla.mozilla.org/show_bug.cgi?id=99306
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•