If we use label inside widget tag then renderLabel macro skip the label rendering due to wrong condition check.
-- Corrected the conditions for label rendering.
-- Also replaced fo:inline with fo:block as fo:inline can't render directly.
Thanks Deepak.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1462257 13f79535-47bb-0310-9956-ffa450edef68
When you have a fieldGroup that contains fields with use-when attribute, if all fields aren't use, the fieldGroup is empty.
Improvment: to not display the field group
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1446847 13f79535-47bb-0310-9956-ffa450edef68
HtmlMenuRenderer generates like bellow form tags. It generates double target="_BLANK" , then cause javascript error.
<li><form method="post" action="/ar/control/invoice.pdf" target="_BLANK" name="InvoiceSubTabBar_pdf_LF_8"><input name="invoiceId" value="8010" type="hidden"/></form><a target="_BLANK" href="javascript:document.InvoiceSubTabBar_pdf_LF_8.submit()">PDF</a></li>
document.InvoiceSubTabBar_pdf_LF_8 is undefined @ javascript:document.InvoiceSubTabBar_pdf_LF_8.submit()
jleroux: to reproduce
For example, edit applications/accounting/webapp/accounting/WEB-INF/controller.xml like this.
<request-map uri="invoice.pdf">
<security https="true" auth="true"/>
<event name="test" type="java" path="org.ofbiz.webapp.event.TestEvent" invoke="test"/> <= add this
<response name="success" type="view" value="InvoicePDF"/>
</request-map>
And in invoice screen, click 'PDF' button. Exist or not exist above line, generated html is different.
As is
~event: PDF rendered
<li><a target="_BLANK" href="/ar/control/invoice.pdf?invoiceId=8010">PDF</a></li>
event: PDF not rendered
<li><form method="post" action="/ar/control/invoice.pdf" target="_BLANK" name="InvoiceSubTabBar_pdf_LF_8"><input name="invoiceId" value="8010" type="hidden"/></form><a target="_BLANK" href="javascript:document.InvoiceSubTabBar_pdf_LF_8.submit()">PDF</a></li>
patched
~event: PDF rendered
<li><a target="_BLANK" href="/ar/control/invoice.pdf?invoiceId=8010">PDF</a></li>
event: PDF rendered
<li><form method="post" action="/ar/control/invoice.pdf" target="_BLANK" name="InvoiceSubTabBar_pdf_LF_8"><input name="invoiceId" value="8010" type="hidden"/></form><a href="javascript:document.InvoiceSubTabBar_pdf_LF_8.submit()">PDF</a></li>
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1422207 13f79535-47bb-0310-9956-ffa450edef68
The PKs are used to keep track of which nodes have been rendered when performing recursion inside Tree Widget rendering code.
Currently Multiple PKs Entities can't be used as nodes in a Tree Widget because the rendering code does not handle them.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1387884 13f79535-47bb-0310-9956-ffa450edef68
Simple formatting (tabs to 2 spaces)
Fixes a bug which prevented to show an i18n "clear" text when layered lookups were used in read only mode from FTL templates
Fixes a bug which prevented to clear the description (at right of button) when layered lookups were used in read only mode
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369561 13f79535-47bb-0310-9956-ffa450edef68
Firefox will throw syntax error if you call javascript void function without parameter.
jleroux: I did not reproduce with FF14 on XP (modern browsers correct by themselves) but I agree it's a better syntax. So I changed all where it was needed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369555 13f79535-47bb-0310-9956-ffa450edef68
The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.
jleroux: since the BshInterpreter is reseted just after with localContext this should not have any bad side effects
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1358735 13f79535-47bb-0310-9956-ffa450edef68
be used. What was occuring previously, was that any use of "null" would
actually end up using GenericEntity.NullField, which has a string value
of "[null-field]".
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341094 13f79535-47bb-0310-9956-ffa450edef68
When specifying the ignore-if-empty attribute inside an entity-constraint in an entity-options a NPE will be thrown whenever the env-name of this entity-constraint is empty.
The error occurs because a null condition is created for the entity-constraint.
When validateSql get called in
org.ofbiz.entity.condition.EntityJoinOperator.validateSql(EntityJoinOperator.java:178)
there is no null checking so when
condition.checkCondition(modelEntity);
gets called an NPE is thrown.
The patch modifies the code in
framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
to avoid the inclusion of a null condition to the entity-options.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340826 13f79535-47bb-0310-9956-ffa450edef68
"As of creating new BeansWrapper, be sure you create it only once during the application life-cycle and then reuse the same instance, or else it will have to rebuild the class introspection cache again and again."
Thanks to Adam Heath for the comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340631 13f79535-47bb-0310-9956-ffa450edef68
"Since BeansWrapper.getDefaultInstance() returns an instance that is
shared in the scope of the class-loader that defined the FreeMarker
classes, and since possibly multiple independently developed
components in your system use FreeMarker and thus getDefaultInstance
(and you may don't even know about it), and since the returned
BeanWrapper can be configured (not read-only), you never know how the
returned BeanWrapper is configured. So you add a 3rd party component,
and if you are unlucky, suddenly your other component is broken.
As of creating new BeansWrapper, be sure you create it only once
during the application life-cycle and then reuse the same instance, or
else it will have to rebuild the class introspection cache again and
again."
I have replaced the usage of the static instance of the BeansWrapper with a newly created object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339504 13f79535-47bb-0310-9956-ffa450edef68
If sorting is enabled for at least one field in the list type form-widget, we get an error, here is the details:
Error executing macro: renderFieldTitle
required parameter: id is not specified.
The problematic instruction:
----------
==> macro renderFieldTitle [on line 53, column 1 in component://widget/templates/csvFormMacroLibrary.ftl]
in user-directive renderFieldTitle [on line 116, column 57 in component://widget/templates/csvFormMacroLibrary.ftl]
in user-directive renderSortField [on line 1, column 1 in Fri May 11 12:33:29 IST 2012]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error executing macro: renderFieldTitle
required parameter: id is not specified.
at freemarker.core.Macro$Context.sanityCheck(Macro.java:211)
Adding a default empty string to the id parameter fixes the issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338570 13f79535-47bb-0310-9956-ffa450edef68
This was due to MacroScreenRenderer.renderScreenletSubWidget() calling HtmlFormRenderer instead of MacroFormRenderer. So there was still a call to the old, now inexistent, call_cal js function.
So this not only fixes this case but also all other similar cases, when a navigation-form-name screenlet attribute was used and a date field used in the related form.
I have also checked there are no other uses of HtmlFormRenderer in MacroScreenRenderer. So I think w are safe from other side effects...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331898 13f79535-47bb-0310-9956-ffa450edef68