编辑模式下的多个操作Liferay MVC

问题描述 投票:0回答:1

我正在关注以下示例:https://github.com/liferay/liferay-blade-samples/blob/7.1/maven/apps/configuration-action/src/main/java/com/liferay/blade/samples/configurationaction/MessageDisplayConfigurationAction.java我的表单中有多个提交按钮。我想用多种方法来处理它们。在Spring MVC Portlet中可以做到这一点。例如,您可以执行以下操作:将按钮的onlclick事件附加到如下所示的函数:

function <portlet:namespace />addGroup(){
    var url = "<portlet:actionURL portletMode='edit'><portlet:param name='action' value='addGroup'/></portlet:actionURL>";
    submitForm(document.<portlet:namespace />fm, url);
}

并且在代码中,我们可以这样:

 @RequestMapping("EDIT")
    @ActionMapping(params = "action=addGroup")
    public void handleAddGroup(ActionRequest actionRequest, ActionResponse response) throws ResearchLibraryException, Exception {
        PortletPreferences preferences = actionRequest.getPreferences();
        // Add something to preferences
        preferences.store();
    }

如何在Liferay MVC中执行相同的操作。我想使用多种方法。目前,我只能执行一种方法,并根据情况进行切换并确定不同的点击次数。

liferay portlet liferay-7 spring-portlet-mvc
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.