Author: jonesde
Date: Tue Mar 17 20:05:34 2009 New Revision: 755377 URL: http://svn.apache.org/viewvc?rev=755377&view=rev Log: Added auto option for link-type that will figure out if a hidden-form is needed or not; the hidden-form option will only work for intra-app links that refer to a request that calls an event; changed the ProductForms hyperlink defs to not specify a link-type any more and just use the auto; note that for targets with parameters inline in the URL and not in the parameter sub-element the parameters will still be in the form action and not in hidden fields, so those need to be changed for this to be effective Modified: ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml ofbiz/trunk/framework/widget/dtd/widget-form.xsd ofbiz/trunk/framework/widget/dtd/widget-menu.xsd ofbiz/trunk/framework/widget/dtd/widget-screen.xsd ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java Modified: ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Tue Mar 17 20:05:34 2009 @@ -419,7 +419,7 @@ <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductPrice" description="${uiLabelMap.CommonDelete}" link-type="hidden-form" also-hidden="false"> + <hyperlink target="deleteProductPrice" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="productPriceTypeId"/><parameter param-name="productPricePurposeId"/> <parameter param-name="currencyUomId"/><parameter param-name="productStoreGroupId"/><parameter param-name="fromDate"/> </hyperlink> @@ -457,7 +457,7 @@ <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductPaymentMethodType" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductPaymentMethodType" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="productPricePurposeId"/><parameter param-name="paymentMethodTypeId"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -482,7 +482,7 @@ <field name="productId"><hidden/></field> <field name="productCategoryId" title="${uiLabelMap.ProductCategory_Id}"> <display-entity entity-name="ProductCategory" also-hidden="true" description="${description}"> - <sub-hyperlink target="EditCategory?productCategoryId=${productCategoryId}" description="${productCategoryId}" link-style="buttontext"/> + <sub-hyperlink target="EditCategory" description="${productCategoryId}" link-style="buttontext"><parameter param-name="productCategoryId"/></sub-hyperlink> </display-entity> </field> <field name="fromDate" title="${uiLabelMap.CommonFromDateTime}"><display/></field> @@ -492,7 +492,7 @@ <field name="comments" title="${uiLabelMap.ProductComments}" ><textarea/></field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="removeProductFromCategory" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="removeProductFromCategory" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="productCategoryId"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -520,7 +520,7 @@ <hyperlink target="/content/control/EditContent?contentId=${contentId}" target-type="inter-app" description="${contentId}" also-hidden="false"/> </field> <field name="removeContent" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="removeContentFromProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="removeContentFromProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="contentId"/><parameter param-name="productContentTypeId"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -592,7 +592,7 @@ </field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="removeContentFromProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="removeContentFromProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId" from-field="productContent.productId"/> <parameter param-name="contentId" from-field="productContent.contentId"/> <parameter param-name="productContentTypeId" from-field="productContent.productContentTypeId"/> @@ -859,7 +859,7 @@ description="${uiLabelMap.CommonUpdate}" also-hidden="false"/> </field--> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="removeSupplierProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="removeSupplierProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="partyId"/><parameter param-name="currencyUomId"/> <parameter param-name="minimumOrderQuantity"/><parameter param-name="availableFromDate"/> </hyperlink> @@ -905,7 +905,7 @@ <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductConfig" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductConfig" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="configItemId"/><parameter param-name="sequenceNum"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -1096,7 +1096,7 @@ <display-entity entity-name="CostComponentType"/> </field> <field name="deleteCostComponent" entry-name="costComponentId" widget-style="buttontext"> - <hyperlink target="deleteCostComponent" also-hidden="false" description="${uiLabelMap.CommonDelete}" link-type="hidden-form"> + <hyperlink target="deleteCostComponent" also-hidden="false" description="${uiLabelMap.CommonDelete}"> <parameter param-name="productId"/><parameter param-name="costComponentId"/> </hyperlink> </field> @@ -1225,7 +1225,7 @@ </drop-down> </field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductMaint" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductMaint" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="productMaintSeqId"/> </hyperlink> </field> @@ -1275,7 +1275,7 @@ </field> <field name="meterName"><text size="20" /></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductMeter" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductMeter" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="productMeterTypeId"/> </hyperlink> </field> @@ -1326,7 +1326,7 @@ </field> <field name="description"><text size="20" /></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductGeo" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductGeo" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="geoId"/> </hyperlink> </field> @@ -1348,7 +1348,7 @@ <field name="productFeatureIactnTypeId"><display-entity entity-name="ProductFeatureIactnType"/></field> <field name="removeFeatureInterAction" title="${uiLabelMap.CommonDelete}" widget-style="buttontext"> - <hyperlink target="removeFeatureIactn" description="${uiLabelMap.CommonDelete}" link-type="hidden-form"> + <hyperlink target="removeFeatureIactn" description="${uiLabelMap.CommonDelete}"> <parameter param-name="productFeatureId"/><parameter param-name="productFeatureIdTo"/><parameter param-name="productId"/> </hyperlink> </field> @@ -1412,7 +1412,7 @@ <display-entity entity-name="ProductFeature" description="${description} [${productFeatureId}]"/> </field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductFeatureApplAttr" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductFeatureApplAttr" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="productFeatureId"/><parameter param-name="attrName"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -1463,7 +1463,7 @@ <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" widget-style="buttontext"> - <hyperlink target="deleteProductSubscriptionResource" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductSubscriptionResource" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="subscriptionResourceId"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -1605,7 +1605,7 @@ </field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink also-hidden="false" description="[${uiLabelMap.CommonDelete}]" target="removeWorkEffortGoodStandard" link-type="hidden-form"> + <hyperlink also-hidden="false" description="[${uiLabelMap.CommonDelete}]" target="removeWorkEffortGoodStandard"> <parameter param-name="productId"/><parameter param-name="workEffortId"/><parameter param-name="workEffortGoodStdTypeId"/><parameter param-name="fromDate"/> </hyperlink> </field> @@ -1620,7 +1620,7 @@ </field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductFacility" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductFacility" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="facilityId"/> </hyperlink> </field> @@ -1662,7 +1662,7 @@ </field> <field name="submitButton" position="2" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> <field name="deleteLink" position="2" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductFacilityLocation" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductFacilityLocation" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="facilityId"/><parameter param-name="locationSeqId"/> </hyperlink> </field> @@ -1705,7 +1705,7 @@ <field name="idValue"></field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteGoodIdentification" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteGoodIdentification" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="goodIdentificationTypeId"/> </hyperlink> </field> @@ -1741,7 +1741,7 @@ <field name="attrValue"><text/></field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteProductAttribute" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductAttribute" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="attrName"/> </hyperlink> </field> @@ -1769,7 +1769,7 @@ </field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> <field name="deleteLink" title="" widget-style="buttontext"> - <hyperlink target="deleteProductGlAccount" description="${uiLabelMap.CommonDelete}" also-hidden="false" link-type="hidden-form"> + <hyperlink target="deleteProductGlAccount" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/><parameter param-name="organizationPartyId"/><parameter param-name="glAccountTypeId"/> </hyperlink> </field> Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Tue Mar 17 20:05:34 2009 @@ -798,9 +798,10 @@ </xs:restriction> </xs:simpleType> </xs:attribute> - <xs:attribute name="link-type" default="anchor"> + <xs:attribute name="link-type" default="auto"> <xs:simpleType> <xs:restriction base="xs:token"> + <xs:enumeration value="auto"><xs:annotation><xs:documentation>If selected the hidden-form type will be used if the url-mode is intra-app and the request specified has an event, otherwise the anchor type will be used.</xs:documentation></xs:annotation></xs:enumeration> <xs:enumeration value="anchor"/> <xs:enumeration value="hidden-form"/> </xs:restriction> @@ -1391,9 +1392,10 @@ <xs:attributeGroup name="attlist.sub-hyperlink"> <xs:attribute type="xs:string" name="use-when"/> <xs:attribute type="xs:string" name="link-style"/> - <xs:attribute name="link-type" default="anchor"> + <xs:attribute name="link-type" default="auto"> <xs:simpleType> <xs:restriction base="xs:token"> + <xs:enumeration value="auto"><xs:annotation><xs:documentation>If selected the hidden-form type will be used if the url-mode is intra-app and the request specified has an event, otherwise the anchor type will be used.</xs:documentation></xs:annotation></xs:enumeration> <xs:enumeration value="anchor"/> <xs:enumeration value="hidden-form"/> </xs:restriction> Modified: ofbiz/trunk/framework/widget/dtd/widget-menu.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-menu.xsd?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-menu.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-menu.xsd Tue Mar 17 20:05:34 2009 @@ -167,9 +167,10 @@ <xs:attribute type="xs:string" name="target"/> <xs:attribute type="xs:string" name="target-window"/> <xs:attribute type="xs:string" name="prefix"/> - <xs:attribute name="link-type" default="anchor"> + <xs:attribute name="link-type" default="auto"> <xs:simpleType> <xs:restriction base="xs:token"> + <xs:enumeration value="auto"><xs:annotation><xs:documentation>If selected the hidden-form type will be used if the url-mode is intra-app and the request specified has an event, otherwise the anchor type will be used.</xs:documentation></xs:annotation></xs:enumeration> <xs:enumeration value="anchor"/> <xs:enumeration value="hidden-form"/> </xs:restriction> Modified: ofbiz/trunk/framework/widget/dtd/widget-screen.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-screen.xsd?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-screen.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-screen.xsd Tue Mar 17 20:05:34 2009 @@ -834,9 +834,10 @@ <xs:attribute type="xs:string" name="name"/> <xs:attribute type="xs:string" name="target-window"/> <xs:attribute type="xs:string" name="prefix"/> - <xs:attribute name="link-type" default="anchor"> + <xs:attribute name="link-type" default="auto"> <xs:simpleType> <xs:restriction base="xs:token"> + <xs:enumeration value="auto"><xs:annotation><xs:documentation>If selected the hidden-form type will be used if the url-mode is intra-app and the request specified has an event, otherwise the anchor type will be used.</xs:documentation></xs:annotation></xs:enumeration> <xs:enumeration value="anchor"/> <xs:enumeration value="hidden-form"/> </xs:restriction> Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Tue Mar 17 20:05:34 2009 @@ -27,12 +27,14 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.webapp.control.ConfigXMLReader; import org.ofbiz.webapp.control.RequestHandler; import org.ofbiz.webapp.taglib.ContentUrlTag; import org.ofbiz.widget.form.ModelForm; @@ -121,7 +123,8 @@ public static void makeHyperlinkByType(Appendable writer, String linkType, String linkStyle, String targetType, String target, List<WidgetWorker.Parameter> parameterList, String description, String targetWindow, ModelFormField modelFormField, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws IOException { - if ("hidden-form".equals(linkType)) { + String realLinkType = WidgetWorker.determineAutoLinkType(linkType, target, targetType, request); + if ("hidden-form".equals(realLinkType)) { if (modelFormField != null && "multi".equals(modelFormField.getModelForm().getType())) { WidgetWorker.makeHiddenFormLinkAnchor(writer, linkStyle, description, modelFormField, request, response, context); @@ -300,4 +303,25 @@ } } } + + public static String determineAutoLinkType(String linkType, String target, String targetType, HttpServletRequest request) { + Debug.logInfo("determineAutoLinkType: linkType=" + linkType + ", target=[" + target + "], targetType=" + targetType, module); + if ("auto".equals(linkType)) { + if ("intra-app".equals(targetType)) { + String requestUri = (target.indexOf('?') > -1) ? target.substring(0, target.indexOf('?')) : target; + ServletContext servletContext = (ServletContext) request.getSession().getServletContext(); + RequestHandler rh = (RequestHandler) servletContext.getAttribute("_REQUEST_HANDLER_"); + ConfigXMLReader.RequestMap requestMap = rh.getControllerConfig().requestMapMap.get(requestUri); + if (requestMap != null && requestMap.event != null) { + return "hidden-form"; + } else { + return "anchor"; + } + } else { + return "anchor"; + } + } else { + return linkType; + } + } } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java Tue Mar 17 20:05:34 2009 @@ -376,7 +376,8 @@ String targetWindow = link.getTargetWindow(context); String uniqueItemName = menuItem.getModelMenu().getName() + "_" + menuItem.getName() + "_LF_" + UtilMisc.<String>addToBigDecimalInMap(context, "menuUniqueItemIndex", BigDecimal.ONE); - if ("hidden-form".equals(link.getLinkType())) { + String linkType = WidgetWorker.determineAutoLinkType(link.getLinkType(), target, link.getUrlMode(), request); + if ("hidden-form".equals(linkType)) { writer.append("<form method=\"post\""); writer.append(" action=\""); // note that this passes null for the parameterList on purpose so they won't be put into the URL @@ -434,7 +435,7 @@ } writer.append(" href=\""); - if ("hidden-form".equals(link.getLinkType())) { + if ("hidden-form".equals(linkType)) { writer.append("javascript:document."); writer.append(uniqueItemName); writer.append(".submit()"); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java?rev=755377&r1=755376&r2=755377&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java Tue Mar 17 20:05:34 2009 @@ -22,7 +22,6 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Locale; import java.util.Map; @@ -34,8 +33,8 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; -import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilFormatOut; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; @@ -460,7 +459,8 @@ String uniqueItemName = link.getModelScreen().getName() + "_LF_" + UtilMisc.<String>addToBigDecimalInMap(context, "screenUniqueItemIndex", BigDecimal.ONE); - if ("hidden-form".equals(link.getLinkType())) { + String linkType = WidgetWorker.determineAutoLinkType(link.getLinkType(), target, link.getUrlMode(), request); + if ("hidden-form".equals(linkType)) { writer.append("<form method=\"post\""); writer.append(" action=\""); // note that this passes null for the parameterList on purpose so they won't be put into the URL @@ -517,7 +517,7 @@ } if (UtilValidate.isNotEmpty(target)) { writer.append(" href=\""); - if ("hidden-form".equals(link.getLinkType())) { + if ("hidden-form".equals(linkType)) { writer.append("javascript:document."); writer.append(uniqueItemName); writer.append(".submit()"); |
Free forum by Nabble | Edit this page |