You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@sandglass-software.com> on 2011/04/17 16:37:36 UTC
Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
This commit breaks the focusFieldName form widget feature.
-Adrian
On 4/17/2011 5:52 AM, sascharodekamp@apache.org wrote:
> Author: sascharodekamp
> Date: Sun Apr 17 12:52:54 2011
> New Revision: 1094138
>
> URL: http://svn.apache.org/viewvc?rev=1094138&view=rev
> Log:
> Improvement: Enables the jQuery validation plugin for all macro generted forms if min one field has the widget-style required.
>
> Modified:
> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>
> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1094138&r1=1094137&r2=1094138&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Apr 17 12:52:54 2011
> @@ -300,7 +300,15 @@ ${item.description}</span>
> <#macro renderFormClose focusFieldName formName>
> </form><#lt/>
> <#if focusFieldName?has_content>
> -<script language="JavaScript" type="text/javascript">document.${formName}.${focusFieldName}.focus();</script><#lt/>
> +<script language="JavaScript" type="text/javascript">
> + var form = document.${formName};
> + form.${focusFieldName}.focus();
> +<#-- enable the validation plugin for all generated forms
> + only enable the validation if min one field is marked as 'required' -->
> + if (jQuery(form).find(".required").size()> 0) {
> + jQuery(form).validate();
> + }
> +</script><#lt/>
> </#if>
> </#macro>
> <#macro renderMultiFormClose>
>
>
Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
Posted by Sascha Rodekamp <sa...@googlemail.com>.
:-) no problem
Have a good Sunday
Am 17.04.2011 um 16:38 schrieb Adrian Crum <ad...@sandglass-software.com>:
> Oops, no it doesn't. Never mind.
>
>
> On 4/17/2011 7:37 AM, Adrian Crum wrote:
>> This commit breaks the focusFieldName form widget feature.
>>
>> -Adrian
>>
>> On 4/17/2011 5:52 AM, sascharodekamp@apache.org wrote:
>>> Author: sascharodekamp
>>> Date: Sun Apr 17 12:52:54 2011
>>> New Revision: 1094138
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1094138&view=rev
>>> Log:
>>> Improvement: Enables the jQuery validation plugin for all macro generted forms if min one field has the widget-style required.
>>>
>>> Modified:
>>> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>>>
>>> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1094138&r1=1094137&r2=1094138&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
>>> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Apr 17 12:52:54 2011
>>> @@ -300,7 +300,15 @@ ${item.description}</span>
>>> <#macro renderFormClose focusFieldName formName>
>>> </form><#lt/>
>>> <#if focusFieldName?has_content>
>>> -<script language="JavaScript" type="text/javascript">document.${formName}.${focusFieldName}.focus();</script><#lt/>
>>> +<script language="JavaScript" type="text/javascript">
>>> + var form = document.${formName};
>>> + form.${focusFieldName}.focus();
>>> +<#-- enable the validation plugin for all generated forms
>>> + only enable the validation if min one field is marked as 'required' -->
>>> + if (jQuery(form).find(".required").size()> 0) {
>>> + jQuery(form).validate();
>>> + }
>>> +</script><#lt/>
>>> </#if>
>>> </#macro>
>>> <#macro renderMultiFormClose>
>>>
>>>
Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
Posted by Adrian Crum <ad...@sandglass-software.com>.
Oops, no it doesn't. Never mind.
On 4/17/2011 7:37 AM, Adrian Crum wrote:
> This commit breaks the focusFieldName form widget feature.
>
> -Adrian
>
> On 4/17/2011 5:52 AM, sascharodekamp@apache.org wrote:
>> Author: sascharodekamp
>> Date: Sun Apr 17 12:52:54 2011
>> New Revision: 1094138
>>
>> URL: http://svn.apache.org/viewvc?rev=1094138&view=rev
>> Log:
>> Improvement: Enables the jQuery validation plugin for all macro
>> generted forms if min one field has the widget-style required.
>>
>> Modified:
>> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>>
>> Modified:
>> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1094138&r1=1094137&r2=1094138&view=diff
>> ==============================================================================
>>
>> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> (original)
>> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> Sun Apr 17 12:52:54 2011
>> @@ -300,7 +300,15 @@ ${item.description}</span>
>> <#macro renderFormClose focusFieldName formName>
>> </form><#lt/>
>> <#if focusFieldName?has_content>
>> -<script language="JavaScript"
>> type="text/javascript">document.${formName}.${focusFieldName}.focus();</script><#lt/>
>> +<script language="JavaScript" type="text/javascript">
>> + var form = document.${formName};
>> + form.${focusFieldName}.focus();
>> +<#-- enable the validation plugin for all generated forms
>> + only enable the validation if min one field is marked
>> as 'required' -->
>> + if (jQuery(form).find(".required").size()> 0) {
>> + jQuery(form).validate();
>> + }
>> +</script><#lt/>
>> </#if>
>> </#macro>
>> <#macro renderMultiFormClose>
>>
>>