Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
how to use new RegionServiceUtil in 7.4
hi
i try use 7.4 ce ga15
now i got problem.
i used to call RegionServiceUtil like
RegionServiceUtil.addRegion(countryId, "TW-CHA","TW-CHA", true);
now it's deprecated
i have to switch to
public static Region addRegion(
long countryId, boolean active, String name, double position,
String regionCode, ServiceContext serviceContext)
can anyone let me know what is position mean, and how to get service context in portlet.
thanks in advance.
Hi ,
If you have request object then you can use
ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
without request object you may use
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(PortalUtil.getDefaultCompanyId());
serviceContext.setUserId(_userLocalService.getDefaultUserId());
For Postion value you can set it with 0
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™