0

I'm doing a simple search engine for my web app and I'm facing a problem.

My search.xhtml works by getting a parameter, so that search.xhtml?key=lol will return the results for "lol".

What I need to do is that my search commandButton will redirect do search.xhtml?key=INPUT TEXT CONTENT.

Here's my simple code :

<div id="searchBox">
        <pou:panel id="searchPanel">                
            <h:form>
                <h:inputText id="searchInput" value="#{dispensaRicercaBean.query}" size="99" maxlength="99"/> <pou:commandButton icon="ui-icon-search" action="ricerca?faces-redirect=true"/>
                <pou:watermark value="Search" for="searchInput"/>
            </h:form>                
        </pou:panel>            
    </div> 

where dispensaRicercaBean is @RequestScoped and my result page loads the data calling executeQuery(#{request.getParameter('key')) (a rough example, actually there are some differences)

How can I do that?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
StepTNT
  • 3,867
  • 7
  • 41
  • 82

1 Answers1

0

Use a plain HTML <form>

<form action="ricera.xhtml">
    <h:inputText id="key" size="99" maxlength="99" />
    <pou:watermark value="Search" for="key" />
    <pou:button icon="ui-icon-search" onclick="submit(); return;" />
</form>                
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555