cancel ajax update

UI Components for JSF
Post Reply
mrifni
Posts: 4
Joined: 16 Nov 2011, 13:37

16 Nov 2011, 13:44

HI,

I want to cancel the ajax dom update based on server side response.
How can I do it ?
I am using primefaces 2.2RC2

<p:ajax update="" listener="" />
if something goes wrong I want to stop updateing the components in the update=""

thank you.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

16 Nov 2011, 13:55

Hi,

You can add update targets via RequestContext. Let "update" attribute not specified and define it in Java programmatically. Success ==> add regular update target (clientId of the component to be updated). Error ==> nothing to add.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

mrifni
Posts: 4
Joined: 16 Nov 2011, 13:37

16 Nov 2011, 15:41

I tried but it didnt work.
here is my code in jsf
<p:ajax process="senderPhone" listener="#{transactionController.senderDetailsListener}" event="blur" />


server code :
public void senderDetailsListener() {

RequestContext context = RequestContext.getCurrentInstance();
context.addPartialUpdateTarget("senderName");
context.addPartialUpdateTarget("senderAddress");
context.addPartialUpdateTarget("senderPostcode");


}

mrifni
Posts: 4
Joined: 16 Nov 2011, 13:37

16 Nov 2011, 15:52

oh its working now.

I just add the form name wih the component id

like this


RequestContext context = RequestContext.getCurrentInstance();
context.addPartialUpdateTarget("myform:senderName");
context.addPartialUpdateTarget("myform:senderAddress");
context.addPartialUpdateTarget("myform:senderPostcode");

then it worked.
thank you guys

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests