Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
Set Primefaces inputText value from Javascript and have ajax fire

I have a primefaces(v10) input text which I need to set from a javascript function and also have an ajax event fire on blur. In my code I have this, but have been unsuccessful in getting the ajax function to fire.

<h:form id="myForm">    
    <p:inputText id="myText" widgetVar="myTextVar" value="#{myBean.myText}">
        <p:ajax event="blur" listener="#{myBean.updateMyText}"                                           update="myForm"/>
    </p:inputText>
</h:form>

I can set the inputText using:

document.getElementById("myForm:myText").value="The Value"

But I'm wondering if I need to use something from the PF() Widget API?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Its easy. Just use the widget...

PF('myTextVar').jq.val('The Value').trigger('change');
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!