jsf - i have two text box in two different pages a -


i have 2 text box in 2 different pages , same variable use in 2 text box when enter value in first text box it's reflection show in second text box , how reduce in jsf ?

you can create @sessionscoped bean named generalbean

set variable there e.g.:

private string name; 

add getters , setters.

in pages user enters data should have

<h:form> <h:inputtext value="#{generalbean.getname}"> <f:ajax event="change" /> </h:inputtext> </h:form> 

using ajax, whenever changes value affect name variable appears in other screen.

edited:

i presumed using jsf2.0. if not, please indicate it.

edited:

since using jsf1.1 need external tool support.

you can use richfaces a4j:support.

for need download richfaces.

use a4j:support. see example here: a4j:support

edited:

this answer if pages not opened simultaneously.if opened @ same time have use richfaces push optionin other one.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -