Primefaces Ajax action not triggering update?

You need to reload the allUsers list in the bean's action method after deleting the user.

Up vote 0 down vote favorite 1 share g+ share fb share tw.

I have the page below, everything works fine... Except that after I click the delete button and hit "Yes Sure" in the Confirm Dialog My page doesn't change... It should show me the same form without that user. I tryed a lot of things, but I am using Primefaces 3.0. M3 My form table is server created so it should be ajax usable.

Anyone got an idea what is wrong? Thanks! #{bundle.

ListOfUsers} Here is the controller method public void deleteAction(String id){ userFacade. Remove(userFacade. Find(Integer.

ParseInt(id))); } This method is being called and it's deleting the user. Java ajax jsf jsf-2.0 primefaces link|improve this question edited Oct 14 '11 at 21:00 asked Oct 14 '11 at 20:48Cfontes909115 91% accept rate.

It's unclear what part exactly isn't working. Does it invoke the action method? Does it return the expected ajax response?

Are you reloading the list in the action method? Etc. – BalusC Oct 14 '11 at 20:52 It's deleting the user all methods are getting invoked, but the update tag of the CommandButton on the confirmDialog is doing nothing.

If I hit F5 and reload the page I get the new table without the deleted User – Cfontes Oct 14 '11 at 20:56 Not reloading the list in the actions method... and not returning anything on the method, I thought the update calling a DIV to refresh would trigger this reload of the List. – Cfontes Oct 14 '11 at 20:58 So, you are not reloading allUsers from the database after deleting the user from the database? – BalusC Oct 14 '11 at 20:59 Is it needed?

I am asking to update the p:dataTable userTable, shouldn't this do that? – Cfontes Oct 14 '11 at 21:02.

You need to reload the allUsers list in the bean's action method after deleting the user. Public void deleteAction(String userId) { userService. Delete(Long.

ValueOf(userId)); allUsers = userService.list(); } Otherwise JSF will just retrieve the original list. You're apparently prepopulating the list in the (post)constructor of a view scoped bean, that's why a F5 works.

You've just to update the property's value in the action method. – BalusC Oct 14 '11 at 21:09 True thing... it's liked to the backend Bean. I am getting a hard time fixing this in my head :D Spring MVC is completely different.

Thanks I think you are the JSF, Primefaces master here 90% of the questions I search got you answer on it. Thanks for that too! – Cfontes Oct 14 '11 at 21:16 If you use a normal action method instead of an action listener, then you can also navigate by a redirect instead, but that would cause a full page refresh.

Spring MVC is as far as I know not ajax enabled, right? – BalusC Oct 14 '11 at 21:21 Yeap not ajax enabled, you have to do it on your own... but the main difference are the backing beans they are very different from Spring MVC controllers. Thanks for the info again!

– Cfontes Oct 14 '11 at 12:31.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions