Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Adrian Crum-3
This commit breaks the focusFieldName form widget feature.

-Adrian

On 4/17/2011 5:52 AM, [hidden email] 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>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Adrian Crum-3
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, [hidden email] 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>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1094138 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Sascha Rodekamp-3
:-) no problem
Have a good Sunday

Am 17.04.2011 um 16:38 schrieb Adrian Crum <[hidden email]>:

> 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, [hidden email] 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>
>>>
>>>