Ankit (Jacques),

the same id should be added to all the other templates/*FormMacroLibrary.ftl 
files even if of course in them it will not be used.

Kind regards,

Jacopo

On Jan 18, 2011, at 9:00 AM, [email protected] wrote:

> Author: jleroux
> Date: Tue Jan 18 08:00:37 2011
> New Revision: 1060229
> 
> URL: http://svn.apache.org/viewvc?rev=1060229&view=rev
> Log:
> A patch from Ankit Jain "The id attribute is not set in the <a> tag." 
> (https://issues.apache.org/jira/browse/OFBIZ-4119) - OFBIZ-4119
> 
> By adding id attribute in the <a> tag then its helpful for developers to 
> perform action on it using js or css. 
> 
> Modified:
>    
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
>    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> 
> Modified: 
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
> URL: 
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=1060229&r1=1060228&r2=1060229&view=diff
> ==============================================================================
> --- 
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java 
> (original)
> +++ 
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java 
> Tue Jan 18 08:00:37 2011
> @@ -2936,6 +2936,7 @@ public class MacroFormRenderer implement
>             String alt = "";
>             String imgTitle = "";
>             String hiddenFormName = 
> WidgetWorker.makeLinkHiddenFormName(context, modelFormField);
> +            String id = modelFormField.getCurrentContainerId(context);
> 
>             if (UtilValidate.isNotEmpty(modelFormField.getEvent()) && 
> UtilValidate.isNotEmpty(modelFormField.getAction(context))) {
>                 event = modelFormField.getEvent();
> @@ -2966,7 +2967,9 @@ public class MacroFormRenderer implement
> 
>             StringWriter sr = new StringWriter();
>             sr.append("<@makeHyperlinkString ");
> -            sr.append("linkStyle=\"");
> +            sr.append("id=\"");
> +            sr.append(id);
> +            sr.append("\" linkStyle=\"");
>             sr.append(linkStyle==null?"":linkStyle);
>             sr.append("\" hiddenFormName=\"");
>             sr.append(hiddenFormName==null?"":hiddenFormName);
> 
> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> URL: 
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1060229&r1=1060228&r2=1060229&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Tue Jan 
> 18 08:00:37 2011
> @@ -601,4 +601,4 @@ jQuery(document).ready(function(){
> 
> <#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow><form 
> method="post" action="${actionUrl}" <#if 
> targetWindow?has_content>target="${targetWindow}"</#if> 
> onsubmit="javascript:submitFormDisableSubmits(this)" name="${name}"><#list 
> parameters as parameter><input name="${parameter.name}" 
> value="${parameter.value}" type="hidden"/></#list></form></#macro>
> <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc 
> description confirmation><a <#if 
> linkStyle?has_content>class="${linkStyle}"</#if> 
> href="javascript:document.${hiddenFormName}.submit()"<#if action?has_content 
> && event?has_content> ${event}="${action}"</#if><#if 
> confirmation?has_content> onclick="return 
> confirm('${confirmation?js_string}')"</#if>><#if imgSrc?has_content><img 
> src="${imgSrc}" alt=""/></#if>${description}</a></#macro>
> -<#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc 
> title alternate linkUrl targetWindow description confirmation><a <#if 
> linkStyle?has_content>class="${linkStyle}"</#if> href="${linkUrl}"<#if 
> targetWindow?has_content> target="${targetWindow}"</#if><#if 
> action?has_content && event?has_content> ${event}="${action}"</#if><#if 
> confirmation?has_content> onclick="return 
> confirm('${confirmation?js_string}')"</#if><#if imgSrc?length == 0 && 
> title?has_content> title="${title}"</#if>><#if imgSrc?has_content><img 
> src="${imgSrc}" alt="${alternate}" 
> title="${title}"/></#if>${description}</a></#macro>
> +<#macro makeHyperlinkString id linkStyle hiddenFormName event action imgSrc 
> title alternate linkUrl targetWindow description confirmation><a id="${id}" 
> <#if linkStyle?has_content>class="${linkStyle}"</#if> href="${linkUrl}"<#if 
> targetWindow?has_content> target="${targetWindow}"</#if><#if 
> action?has_content && event?has_content> ${event}="${action}"</#if><#if 
> confirmation?has_content> onclick="return 
> confirm('${confirmation?js_string}')"</#if><#if imgSrc?length == 0 && 
> title?has_content> title="${title}"</#if>><#if imgSrc?has_content><img 
> src="${imgSrc}" alt="${alternate}" 
> title="${title}"/></#if>${description}</a></#macro>
> 
> 

Reply via email to