All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.commerce_order.edit_billing_address.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.114
Show newest version
<%--
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */
--%>

<%@ include file="/init.jsp" %>

<%
String cmd = ParamUtil.getString(request, Constants.CMD);

CommerceOrderEditDisplayContext commerceOrderEditDisplayContext = (CommerceOrderEditDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);

CommerceAddress billingAddress = null;

CommerceOrder commerceOrder = commerceOrderEditDisplayContext.getCommerceOrder();

if ((commerceOrder != null) && Validator.isNull(cmd)) {
	billingAddress = commerceOrder.getBillingAddress();
}
%>



new Liferay.DynamicSelect([ { select: 'countryId', selectData: function (callback) { function injectCountryPlaceholder(list) { var callbackList = [ { countryId: '0', nameCurrentValue: '- ', }, ]; list.forEach((listElement) => { callbackList.push(listElement); }); callback(callbackList); } Liferay.Service( '/commerce.commercecountrymanagerimpl/get-billing-countries', { active: true, billingAllowed: true, companyId: '<%= company.getCompanyId() %>', }, injectCountryPlaceholder ); }, selectDesc: 'nameCurrentValue', selectId: 'countryId', selectNullable: <%= false %>, selectSort: '<%= true %>', selectVal: '<%= BeanParamUtil.getLong(billingAddress, request, "countryId") %>', }, { select: 'regionId', selectData: function (callback, selectKey) { function injectRegionPlaceholder(list) { var callbackList = [ { regionId: '0', name: '- ', nameCurrentValue: '- ', }, ]; list.forEach((listElement) => { callbackList.push(listElement); }); callback(callbackList); } Liferay.Service( '/region/get-regions', { active: true, countryId: Number(selectKey), }, injectRegionPlaceholder ); }, selectDesc: 'name', selectId: 'regionId', selectNullable: <%= false %>, selectVal: '<%= BeanParamUtil.getLong(billingAddress, request, "regionId") %>', }, ]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy