Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
Unknown
-
Description
Macro parameters of a numeric type, such as int, long, float or double, are displayed in the Edit Macro dialog as a plain text input. Any value is accepted, including letters, and the dialog submits it. The user only finds out the value is invalid when the macro is rendered with an error.
There is no HTML displayer for numeric types, so they fall back to html_displayer/default.vm, which outputs an <input type="text">. The dialog's validation only checks that mandatory parameters are not empty.
Steps to reproduce
- Edit a page with the WYSIWYG editor.
- Insert the Table of Contents macro.
- Type abc in the start parameter and submit.
Expected
The field only accepts numbers. An invalid value is flagged next to the field and the dialog does not submit until it is fixed.
Actual
The dialog submits, and the macro renders an error.
Proposal
- Add HTML displayer edit templates for the numeric types that output an <input type="number">, with a step allowing decimals for the floating point types.
- Make the Edit Macro dialog run the browser validation of its inputs before submitting, and flag the invalid field the same way an empty mandatory field is flagged.
Attachments
Issue Links
- blocks
-
CHARTJS-42 Use number fields and lists of values for the parameters of the chartjs and tableToChartJS macros
-
- Open
-
-
JWPLAYER-29 Use number fields for the width and height of the JW Player macro
-
- Open
-
-
XWIKI-25497 Use a number field for the number of events of the notifications macro
-
- Open
-
-
XWIKI-25498 Use number fields and a list of page properties for the parameters of the page list and tree macros
-
- Open
-
-
XWIKI-25499 Use number fields and lists of values for the parameters of the attachment picker macros
-
- Open
-
- is related to
-
XCOMMONS-3847 Invalid boolean and number values of a bean property are silently converted instead of failing
-
- Open
-
-
XWIKI-25287 The Edit Macro dialog doesn't enforce the constraints declared on the parameters of Java macros
-
- Open
-
-
XWIKI-25457 Provide a field for CSS values in the Edit Macro dialog
-
- Open
-
- relates to
-
XWIKI-25183 Allow the page and attachment pickers to reject references to entities that don't exist
-
- Open
-
-
XWIKI-25197 Allow wiki macro parameters to declare a range or a format for their value
-
- Open
-
-
XWIKI-25586 Declare the minimum of the limit and offset parameters of the Live Data macro
-
- Open
-