Foren
Update user session after update
Kevin Gebel, geändert vor 12 Jahren.
Update user session after update
Junior Member Beiträge: 80 Beitrittsdatum: 27.05.10 Neueste Beiträge
Hello !
I am updating user's attributes in a portlet (name, surname, etc.). How can I refresh user's session to update the UI (username in dockbar, etc.) ?
Thanks,
Kevin
I am updating user's attributes in a portlet (name, surname, etc.). How can I refresh user's session to update the UI (username in dockbar, etc.) ?
Thanks,
Kevin
Thiago Leão Moreira, geändert vor 12 Jahren.
RE: Update user session after update
Liferay Legend Beiträge: 1449 Beitrittsdatum: 10.10.07 Neueste Beiträge
Hey Kevin,
Are your changes available in the database? I'm pretty sure that once you update the User object in the database Liferay will update the interface automagically.
Are your changes available in the database? I'm pretty sure that once you update the User object in the database Liferay will update the interface automagically.
Kevin Gebel, geändert vor 12 Jahren.
RE: Update user session after update
Junior Member Beiträge: 80 Beitrittsdatum: 27.05.10 Neueste Beiträge
Yes, database is updated correctly. But the dockbar is not up to date...
Thiago Leão Moreira, geändert vor 12 Jahren.
RE: Update user session after update
Liferay Legend Beiträge: 1449 Beitrittsdatum: 10.10.07 Neueste Beiträge
Which service/method are you using to update the user?
Kevin Gebel, geändert vor 12 Jahren.
RE: Update user session after update
Junior Member Beiträge: 80 Beitrittsdatum: 27.05.10 Neueste Beiträge
I use UserLocalServiceUtil.updateUser(liferayUser).
Fields are updated in the database.
Fields are updated in the database.
Thiago Leão Moreira, geändert vor 12 Jahren.
RE: Update user session after update
Liferay Legend Beiträge: 1449 Beitrittsdatum: 10.10.07 Neueste Beiträge
Humm, try to use the UserLocalServiceUtil.updateUser(long, userId, .... ServiceContext serviceContext). I know that this method has a big list of parameters but this is the right method to call when updating an user.
Sandeep Nair, geändert vor 12 Jahren.
RE: Update user session after update
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Thats really strange. Even updateUser with just one argument should work properly. Can you please check/debug in UserPersistenceImpl.updateImpl(com.liferay.portal.model.User user, boolean merge)
I am not sure which finder is used in dock. But the caches are cleared and refilled in the method, whether it be argument with User or the multi argument method.
Regards,
Sandeep
I am not sure which finder is used in dock. But the caches are cleared and refilled in the method, whether it be argument with User or the multi argument method.
Regards,
Sandeep
Kevin Gebel, geändert vor 12 Jahren.
RE: Update user session after update
Junior Member Beiträge: 80 Beitrittsdatum: 27.05.10 Neueste Beiträge
I forgot to specify : if I refresh my page (F5), the dockbar is updated.