How to access html components in JSF EL? -


i want code in facelet (jsf 2.0) work:

  <h:inputtext id="q" />   <h:button outcome="/search.xhtml?q=#{q.value}" /> 

but when press button, search page opens without parameters.

i think, el expression wrong. possible access inputtext value el expression? if not, how can achieve same functionality?

i've finished using plain html form:

<form action="faces/search.xhtml" method="get">       <input type="text" name="query" />       <input type="submit" value="find" /> </form> 

in search.xhtml have view param value of query string:

    <f:metadata>         <f:viewparam name="query" />     </f:metadata> 

this solution has problem - "faces/search.xhtml" hardcoded. also, when place form in search.xhtml , perform several searches have in browser url:

"http://localhost:8080/application/faces/faces/faces/search.xhtml"

i think problem can solved prettyfaces (todo :)


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -