In HTML 5 it is possible to use attributes like required, autocomplete etc. Currently Wicket ignores such attributes and does not parse them into anything meaningful, except IIRC the markup id.What we could do is the following: public class TextField ... { @Override protected void onInitialize() { super.onInitialize(); setRequired(getMarkupAttributes().containsKey("required"))); setEnabled(getMarkupAttributes().containsKey("enabled"))); } } By doing this in onInitialize() we don't override anything done in onConfigure, but we would negate anything set on the component prior to it being added to the page. For example: TextField tf = new TextField( ... ); tf.setRequired(false); add(tf); <input type="text" wicket:id="" required> would ultimately result in a required field Another thing is that if/when we allow this, the next thing folks want is to make it conditional... and then we have Wicket JSPs... So I'm not sure if it is a good idea to enable component configuration from the markup. Martijn
Well, if these markup attributes are part of HTML 5 standard I think
that Wicket should support them somehow. But it would be useful if we
could switch on/off this kind of configuration with a new method, like
enableMarkupConfig(boolean enabled)
- HTML 5 and Wicket: configuration from markup? Martijn Dashorst
- Re: HTML 5 and Wicket: configuration from markup? Jeremy Thomerson
- Re: HTML 5 and Wicket: configuration from markup... Martin Grigorov
- Re: HTML 5 and Wicket: configuration from ma... Jeremy Thomerson
- Re: HTML 5 and Wicket: configuration fro... Jeremy Thomerson
- Re: HTML 5 and Wicket: configuratio... Martin Grigorov
- Re: HTML 5 and Wicket: configuration from markup... Igor Vaynberg
- Re: HTML 5 and Wicket: configuration from markup? andrea del bene
