Search code examples
htmljavafxjava-8maxlengthjavafx-webengine

maxlength property not working with javafx webview


I'm developing an application using Struts2.

It works fine in Chrome/IE etc. On JavaFX webview the maxlength property doesn't restrict the user input to the specified amount.

Sample code:

<s:textfield  name = "user_cno" 
             label = "Contact No" 
                id = "idContactNo" 
             class = "inputField" 
         maxlength = "10" />

I've tried changing the User Agent to the following:

  • Mozilla/5.0
  • AppleWebKit/537.44
  • JavaFX/8.0
  • Safari/537.44

but it didn't work for any of them.


Solution

  • This is a WebView bug that has been injected in Java8. There is an unassigned open ticket for the same in the JavaFX developers JIRA community.

    You can sign up for free and vote for the issue if you want it to be resolved asap.