jsf - Reference inputText value from link param -
i have p:inputtext
component , h:link
that navigate different view:
<p:inputtext id="searchvalue" value="#{bean.searchvalue}"> <p:ajax event="keyup" update="search" /> </p:inputtext> <h:link id="search" value="search" outcome="ressearch"> <f:param name="searchvalue" value="#{bean.searchvalue}" /> </h:link>
the ressearch
page use searchvalue
parameter , executes search based on it, after presents result:
<f:metadata> <f:viewparam name="searchvalue" value="#{searchbean.searchvalue}" /> <f:event type="prerenderview" listener="#{searchbean.init}" /> </f:metadata>
i'd rather not use ajax value of inputtext
component. possible value inputtext
directly (without using bean properties) , set value of param
?
just use plain html form.
<form action="ressearch.xhtml"> <input name="searchvalue" class="ui-widget ui-inputfield ui-inputtext ui-state-default ui-corner-all" /> <input type="submit" value="search" /> </form>
use if necessary css make button link, or use js submit form <a>
.
see also:
- what can <f:metadata>, <f:viewparam> , <f:viewaction> used for? - check section "use forms in jsf"
Comments
Post a Comment