Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faces 4.0: add <h:inputText type> #1560

Closed
BalusC opened this issue Feb 26, 2021 · 4 comments
Closed

Faces 4.0: add <h:inputText type> #1560

BalusC opened this issue Feb 26, 2021 · 4 comments
Milestone

Comments

@BalusC
Copy link
Member

BalusC commented Feb 26, 2021

Add new attribute <h:inputText type> to allow HTML5 types such as

  • email
  • search
  • tel
  • url
  • number (along with min, max and step attributes)
  • range (along with min, max and step attributes)
  • datetime-local
  • month
  • time
  • week
  • date
  • color

https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types

NOTE: API may not validate/reject unknown ones as they are essentially extensible. Probably at most in dev stage log a warning when types are used for which a different standard component should be preferred such as secret, submit, file, hidden, checkbox and radio.

Currently already possible and working fine with help of passthrough attributes. But it's better and cleaner if it's directly supported by API.

Moreover, it would particularly on number/range based inputs be totally awesome if any minimum and maximum attribute of any attached <f:validateXxxRange> is consulted during render so that it's automatically rendered as min and max attributes.

@arjantijms arjantijms added the 4.0 label Mar 27, 2021
@arjantijms arjantijms added this to the 4.0 milestone Mar 27, 2021
@tandraschko
Copy link

i think we really have to think about this in general. Its very simliar to #1507

Should we continue to always manually add those attributes/events? or should we maybe accept all attributes and render them as passthrought.
Sure, taglib and IDE completion is the problem then.

@BalusC
Copy link
Member Author

BalusC commented Mar 30, 2021

It's not the same.

Current ticket is basically:

  • add type attribute to <h:inputText> (only one attribute! so not a new one for every new HTML5 type)
  • adjust renderer to log a dev warning when secret, submit, file, hidden, checkbox or radio is used (because there are already separate components for them), or perhaps just throw exception?
  • Optionally: if type is number or range, and there's a <f:validateXxxRange> then automatically render min and max as well

Other ticket is basically:

  • Add about 48 new attributes all starting with on to about 12 existing components, and take into account that we should repeat this every 5~10 years.

BalusC pushed a commit to eclipse-ee4j/mojarra that referenced this issue Apr 3, 2021
BalusC pushed a commit to eclipse-ee4j/mojarra that referenced this issue Apr 3, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 3, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 3, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 3, 2021
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Apr 3, 2021
@BalusC
Copy link
Member Author

BalusC commented Apr 3, 2021

<h:inputText type> has been added: eclipse-ee4j/mojarra@6733916

Before looking at min/max/step attributes I'm awaiting feedback/objections for

Moreover, it would particularly on number/range based inputs be totally awesome if any minimum and maximum attribute of any attached <f:validateXxxRange> is consulted during render so that it's automatically rendered as min and max attributes.

If no feedback nor objections then I won't implement that (but only add the three new attributes).

@BalusC
Copy link
Member Author

BalusC commented Apr 14, 2021

I won't add the three new attributes in context of this ticket either. It's going to be a little more involved because people will be expecting server side validation on them and these should technically speaking also be compatible with date types such as type="datetime-local" and type="time". This really needs to be well thought out. I was initially thinking of getMin() and getMax() attributes being of Comparabe<T> type where T should be assignable to whatever is returned by getValue(). But that deserves a separate ticket for discussion.

@BalusC BalusC closed this as completed Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants