To manage preferences in your portlet you need to add preferences in your portlet.xml in
this way:
| <portlet>
| <portlet-name>YourPortlet</portlet-name>
|
<portlet-class>org.yourcompany.portlet.content.YourPortlet</portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>Your Portlet Title</title>
| </portlet-info>
| <portlet-preferences>
| <preference>
| <name>numberContactPerPage</name>
| <value>10</value>
| </preference>
| </portlet-preferences>
| </portlet>
|
Then in your portlet you can use this snippet:
| public void processAction (ActionRequest request, ActionResponse
| actionResponse)
| throws PortletException, java.io.IOException {
| PortletPreferences pref = request.getPreferences();
|
pref.setValue("15",request.getParameter("numberContactPerPage"));
| pref.store();
| actionResponse.setPortletMode(PortletMode.VIEW);
| actionResponse.setRenderParameters(request.getParameterMap());
| }
|
Hope this helps.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214599#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...