PRIMEFACE+JSF Actual work needs to click on a tree to add the associated text to the Inputtextarea text box, Inputtextarea allows the user to arbitrarily change the Ajax binding tree's Select event, but when clicked, The background Bean object cannot get the actual contents of the foreground text box changes in real time.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/40/wKioL1Xfv2TTC2k-AABKs_U6Mvo654.jpg "title=" 1.jpg " alt= "Wkiol1xfv2ttc2k-aabks_u6mvo654.jpg"/>
Reason estimates Ajax controls cannot associate foreground text box data to the background.
Solution:
Add a button and text box mouse event, Event JS Invoke button click event, and the button will synchronize the folder data to the background.
Front Code:
<script>function callbutton () {document.getElementById ("FIRST:TJ"). Click (); </script>
Background code:
@ManagedBean (name = "Inputrule") @SessionScopedpublic class Inputrule implements Serializable {//Construction common tree operation definition area private TreeNode sgnrroot;//Construction Content rootprivate TreeNode sgnrnode;//Select a content common language private list<string> nrcyylist = new arraylist& Lt String> ()///content common terms all objects public String getinit () {sgnrroot = new Defaulttreenode ("Root", null); Nrcyylist.clear (); Nrcyylist.add ("a"); for (String str:nrcyylist) {TreeNode SGXM = new Defaulttreenode (str, sgnrroot);} return null;} private string Text= "";p ublic string GetText () {return text;} public void SetText (String text) {this.text = text;} public void addinputstring () {text + = "Test 1,";} public void GetInputString () {String a = text;}}
Primeface using AJAX controls in JSF cannot update text box Inputtextarea content in real time