Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
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 Respuestas
Responde la pregunta

0

Its easy. Just use the widget...

PF('myTextVar').jq.val('The Value').trigger('change');
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda