How to update component using client side api?

UI Components for JSF
Post Reply
werdex
Posts: 6
Joined: 09 Nov 2011, 10:46

13 Dec 2011, 13:49

Hi all,
I need to force component update from javascript by using component's widgetVar. However, there are no methods 'update' or 'refresh' in p:inputText. Any ideas?

felipecaparelli
Posts: 10
Joined: 19 Oct 2012, 16:33

05 Feb 2015, 21:12

Hi, I am trying to update a selectOneRadio button by javascript... I want to disable it only in the client side. Is that possible?
I can use jQuery to do this, but the component in the form, that is built by PrimeFaces, doesn't get the effect.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

05 Feb 2015, 23:24

try ith with remoteCommand.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

felipecaparelli
Posts: 10
Joined: 19 Oct 2012, 16:33

25 Feb 2015, 17:45

I'd like to use the PrimeFaces client API (PF), but I will try the remoteCommand instead.

Thanks.

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

26 Feb 2015, 12:53

felipecaparelli wrote:I'd like to use the PrimeFaces client API (PF), but I will try the remoteCommand instead.

Thanks.
Remote command does what you want, it just looks like a server side component. In truth the necessary JavaScript is rendered to the page.
You set the remoteCommand update attribute to the component(s) you want to update after the remoteCommand is executed.
The remoteCommand provides you with a JavaScript function with the same name as set in the remoteCommand name attribute. Call it and the necessary AJAX request(s) will be made to update the component(s) you want.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests