Primeface using AJAX controls in JSF does not update text box Inputtextarea content in real time

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.