Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-125224 Navigate to Address table after adding or editing an address #97176

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -25,7 +25,6 @@
import com.liferay.portal.kernel.service.ServiceContextFactory;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.Constants;
import com.liferay.portal.kernel.util.Http;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys;
Expand Down Expand Up @@ -89,20 +88,15 @@ protected void doProcessAction(

String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

String redirect = ParamUtil.getString(actionRequest, "redirect");

if (cmd.equals(Constants.ADD)) {
Address address = addAccountEntryAddress(actionRequest);

redirect = _http.setParameter(
redirect,
actionResponse.getNamespace() + "accountEntryAddressId",
address.getAddressId());
addAccountEntryAddress(actionRequest);
}
else if (cmd.equals(Constants.UPDATE)) {
updateAccountEntryAddress(actionRequest);
}

String redirect = ParamUtil.getString(actionRequest, "redirect");

if (Validator.isNotNull(redirect)) {
sendRedirect(actionRequest, actionResponse, redirect);
}
Expand Down Expand Up @@ -137,7 +131,4 @@ protected void updateAccountEntryAddress(ActionRequest actionRequest)
@Reference
private AddressLocalService _addressLocalService;

@Reference
private Http _http;

}
Expand Up @@ -37,7 +37,7 @@ renderResponse.setTitle((accountEntryAddressId == 0) ? LanguageUtil.get(request,
action="<%= editAccountEntryAddressURL %>"
>
<aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= (accountEntryAddressId == 0) ? Constants.ADD : Constants.UPDATE %>" />
<aui:input name="redirect" type="hidden" value="<%= currentURL %>" />
<aui:input name="redirect" type="hidden" value="<%= backURL %>" />
<aui:input name="accountEntryAddressId" type="hidden" value="<%= accountEntryAddressId %>" />
<aui:input name="accountEntryId" type="hidden" value="<%= accountEntryDisplay.getAccountEntryId() %>" />

Expand Down