avoiding hard-coding HTML names

2014-07-12 Thread Garret Wilson
Hi, all. I notice that throughout the code HTML element and attribute names are hard-coded. Does Wicket have a list of HTML name and attribute constants that we could reference? I would find that a lot safer, and perhaps even more readable. Not only that, it would allow us to quickly find all t

Re: avoiding hard-coding HTML names

2014-07-17 Thread Martin Grigorov
Hi, The main problem I see with this is that we cannot cover all possible names. 1) It is possible to create custom HTML elements in JavaScript. So the list of names should be easy to extend 2) with Web Components standard custom names are used even more often 3) and yes, some users use Wicket to

Re: avoiding hard-coding HTML names

2014-07-17 Thread Martijn Dashorst
Not a Java or Wicket article, but interesting nonetheless: http://inessential.com/2014/07/14/string_constants I'm not a big fan of putting everything in constants in a central location. We won't be changing an anchor tag from a to anchor across all code in Wicket, ever. There has to be a benefit

Re: avoiding hard-coding HTML names

2014-07-17 Thread Martijn Dashorst
On Thu, Jul 17, 2014 at 1:09 PM, Martin Grigorov wrote: > The main problem I see with this is that we cannot cover all possible names. > 1) It is possible to create custom HTML elements in JavaScript. So the list > of names should be easy to extend +1 > 2) with Web Components standard custom nam

Re: avoiding hard-coding HTML names

2014-07-18 Thread Garret Wilson
I wasn't trying to "validate" or "restrict" HTML tag names---I just thought it helpful to provide some constants for the HTML tags we use all the time, so that some programmer (e.g. me) doesn't make a typo. Do you see any value in adding a boolean Tag.hasName(String) method that handles the eq

Re: avoiding hard-coding HTML names

2014-07-18 Thread Martin Grigorov
On Jul 18, 2014 8:10 PM, "Garret Wilson" wrote: > > I wasn't trying to "validate" or "restrict" HTML tag names---I just thought it helpful to provide some constants for the HTML tags we use all the time, so that some programmer (e.g. me) doesn't make a typo. do you suggest to add constants only f

Re: avoiding hard-coding HTML names

2014-07-18 Thread Garret Wilson
On 7/18/2014 5:14 PM, Martin Grigorov wrote: On Jul 18, 2014 8:10 PM, "Garret Wilson" wrote: I wasn't trying to "validate" or "restrict" HTML tag names---I just thought it helpful to provide some constants for the HTML tags we use all the time, so that some programmer (e.g. me) doesn't make a

Re: avoiding hard-coding HTML names

2014-07-19 Thread Martin Grigorov
Hi, Feel free to create a Pull Request (at GitHub) or attach a patch (though it is harder to review & comment when working with patches) and we can discuss this further. It is just that I don't see much value in this suggestion. There were no problems with the hardcoded tag names in some of the co