Because the w3c-spec says

"step = "any" or positive floating-point number NEW
Specifies the value granularity of the element’s value."

and

"Positive floating-point number #
A non-negative floating-point number, with the following restriction:
must be greater than zero"

http://dev.w3.org/html5/markup/input.number.html

it should be valid to use 0 or <0 as special constant in NumberTextField.

NumberTextField

public static final Number ANY = 0;

and


        @Override
        protected void onComponentTag(final ComponentTag tag)
        {
...

                if (step != null)
                {
                        if (step.equals(ANY)
                        {
                                attributes.put("step", "any");
                        }
                        else
                        {
                                attributes.put("step", 
Objects.stringValue(step));
                        }
                }
                else
                {
                        attributes.remove("step");
                }
...
        }

This should do the trick without any change in current behavior.

Thanks
Per

Then i could do
> Gesendet: Freitag, 10. Januar 2014 um 09:01 Uhr
> Von: "Per Newgro" <[email protected]>
> An: "wicket usergroup" <[email protected]>
> Betreff: NumberTextField eats my markup step attribute
>
> Hi,
> 
> i would like to enable float values in my form (without validation error).
> But it's not possible for me.
> 
> If i add this input markup
> 
> <input type="number" step="any" wicket:id="myNumber" />
> 
> and assign a
> 
> new NumberTextField<Double>("myNumber", numberModel);
> 
> the resulting markup is
> 
> <input type="number" id="myNumber1" />
> 
> So i'm not able to get a valid form submit with a value of 12.5 because 
> step="any" has been removed
> (NumberTextField@190).
> 
> The NumberTextField.setStep is also unusable because it uses a Number 
> parameter
> which is "any" obviously not :-).
> 
> is there another workaround or is a ticket required?
> 
> Thanks for your support
> Per
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to