In the search box, the user type a word, like "iPhone", and click "Search", the system performs backend search and return all information for "iPhone". In the end, it also output a related word "iPod" through wordController.related variable. If the user clicks "iPod" link, the system needs to pass iPod as another word to perform search, and return results again. My question, how can I pass "iPod" (the "related" variable) as another search variable and perform backend search? This time, it is not through h:inputText and h:commandButton, since it's not user entered value.
Thank you for your help!
<h:form id="wordForm">
<h:panelGrid columns="3">
<h:outputLabel for="word">Enter a word:</h:outputLabel>
<h:inputText id="word"
value="#{wordController.word}" />
<h:message for="word" />
</h:panelGrid>
<h:commandButton id="search" value="Search!"
action="#{wordController.info}" />
</h:form>
<br />
<h:outputText value="#{wordController.wordInfo}"
rendered="#{not empty wordController.wordInfo}" />
<h:link value="#{wordController.related}" />