Portlets have an EDIT mode, and this is the way we can parametrize them.
My question is what it the best way to parametrize a portlet exactly at the moment its loaded, programmatically.
For example: I want to get Liferay to load two instances of the portlet with a certain ID, one with paramA, second with paramB.
To load different parameters (better known in Liferay as “Portlet Preferences”) you can use PortletPreferences to store and retrieve different parameters,
The factory takes 2 parameters,
With this object you can get parameters:
And you can store values: