Page 1 of 1

Updating sidebar

Posted: 25 Mar 2020, 19:58
by Lee Gao Shei
Good evening,

This may have been asked before, so I apologise for not doing my part to do a thorough search.

Is it possible to do an ajax update on a sidebar when a commandButton is click?

Here's my current situation:

I have 2 sidebars; 1 for when I click "view profile" and 1 for when I click "edit profile". I have a commandButton on edit profile which has an actionListener to do the necessary updates. All of the managedBean methods are done correctly and it's updating correctly. However, I want the changes to reflect on the "view profile" sidebar without having to refresh the page, but I'm unsure what to put inside the update attribute.

Here's a snippet of my commandButton with the update attribute left empty:

Code: Select all

<p:commandButton value="Edit profile" update="" actionListener="#{editMyProfileManagedBean.updateProfile}"/>

Re: Updating sidebar

Posted: 26 Mar 2020, 17:51
by Melloware
Can't you give the sidebar and ID and then reference that ID in the update="" ?