0

I'm trying to take an existing JSF 2 page and style it using JQuery Mobile (JQM). The problem is that JSF won't handle some of the JQM attributes. For example, I want to create a JQM-styled search input:

<input type="search" name="search" id="search" />

In order for this to be integrated with the JSF page, I have tried this:

<h:inputText type="search" name="search" id="search" value="#{bean.searchText}"/>

JSF does not accept a type attribute, so the rendered HTML looks like this:

<input type="text" name="search" id="search" />

This does not produce the proper JQM search widget :-(

I've googled for hours and have not found any examples of the integration of the two. Any ideas on how to make JQM and JSF play nicely? Thanks in advance!

Paul Waldo
  • 1,131
  • 10
  • 26

2 Answers2

1

"To overcome this, you would need to create a custom component or, better, just a custom renderer which overrides the standard <h:inputText> renderer and takes the custom attributes into account."

Take a look at BalusC complete explanation and suggested solution over here : JSF 2.0 strips out needed HTML5 attributes

Community
  • 1
  • 1
Daniel
  • 36,833
  • 10
  • 119
  • 200
0

You can use jQuery or javascript to add attributes after the page is rendered.

Dean
  • 1