Hi Jacques (and everyone else who does this),

Please avoid littering the freemarker templates with redundant ?if_exists and ! 
defaults.  A quick look at the groovy script makes it pretty clear that 
taskCost.task will always be available (since it is the basis for the 
preparation) and obviously task.workEffortId will be available since it is the 
primary key.  Quite often if a value is required for the proper functioning of 
the screen then having freemarker throw an error is absolutely the right thing 
to do so that the true cause can be fixed instead of hiding the problem away.

Thanks
Scott

On 11/09/2011, at 12:11 AM, jler...@apache.org wrote:

> Author: jleroux
> Date: Sat Sep 10 12:11:03 2011
> New Revision: 1167501
> 
> URL: http://svn.apache.org/viewvc?rev=1167501&view=rev
> Log:
> A modified patch from  Deepak Dixit "Incorrect markup for Production Run 
> Costs page." https://issues.apache.org/jira/browse/OFBIZ-4395
> 
> 
> In ProductionRunCosts.ftl there is unclosed div for screenlet-body, due to 
> this unclosed page not render properly. You can view this behavior properly 
> in Tomahawk theme. 
> 
> jleroux: I added also some checks to prevent unlikely NPEs
> 
> Modified:
>    
> ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
> 
> Modified: 
> ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
> URL: 
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl?rev=1167501&r1=1167500&r2=1167501&view=diff
> ==============================================================================
> --- 
> ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
>  (original)
> +++ 
> ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
>  Sat Sep 10 12:11:03 2011
> @@ -18,13 +18,14 @@ under the License.
> -->
> 
> <#list taskCosts as taskCost>
> -<div class="screenlet">
> -  <div class="screenlet-title-bar">
> -    <#assign task = taskCost.task>
> -    <#assign costsForm = taskCost.costsForm>
> -    <h3>${uiLabelMap.ManufacturingActualCosts} 
> ${task.workEffortName?if_exists} [${task.workEffortId}]</h3>
> -    ${costsForm.renderFormString(context)}
> +  <div class="screenlet">
> +    <div class="screenlet-title-bar">
> +      <#assign task = taskCost.task!>
> +      <h3>${uiLabelMap.ManufacturingActualCosts} 
> ${task.workEffortName?if_exists} [${task.workEffortId?if_exists}]</h3>
> +    </div>
> +    <div class="screenlet-body">
> +      <#assign costsForm = taskCost.costsForm>
> +      ${costsForm.renderFormString(context)}
> +    </div>
>   </div>
> -  <div class="screenlet-body">
> -</div>
> </#list>
> \ No newline at end of file
> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to