JSP:
<aui:option value="<%=billClaimPortletKeys.pending %>">Pending for approval</aui:option><aui:option value="<%=billClaimPortletKeys.approved%>">Approved</aui:option>
Constants file
public class billClaimPortletKeys {
public static final String billClaim = "BillClaim";
public static final String approved = "Approved";
public static final String pending = "Pending For Approval";
public static final String medical = "Medical";
public static final String travel = "Travel";
public static final String food = "Food";
public static final String variablepay = "Variablepay";
public static final String teamouting = "Team Outing";
public static final String others = "Others";
}
action.jsp
<%
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Billclaim bill = (Billclaim) row.getObject();
long fooId = ParamUtil.getLong(request, "fooId");
PortletURL approvedURL = renderResponse.createActionURL();
approvedURL.setParameter(ActionRequest.ACTION_NAME, "approved");
approvedURL.setParameter("fooId", String.valueOf(bill.getFooId()));
%>
<liferay-ui:icon-menu>
<%{ %>
<liferay-ui:icon image="delete" message="Delete" url="<%= deleteBillURL.toString()%>" />
<liferay-ui:icon image="check" message="Approved" url="<%=approvedURL.toString() %>" />
<%} %>
</liferay-ui:icon-menu>
Controller
public void approved(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException, SystemException, PortalException {
Billclaim billclaim =null;
String approved = billClaimPortletKeys.approved;
long fooId = ParamUtil.getLong(actionRequest, "fooId");
System.out.println("FooooID##################" +fooId);
billclaim = BillclaimLocalServiceUtil.fetchBillclaim(fooId);
billclaim.setStatus(approved);
BillclaimLocalServiceUtil.updateBillclaim(billclaim);
}