Re: svn commit: r1334201 - /ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml

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

Re: svn commit: r1334201 - /ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml

Jacques Le Roux
Administrator
I checked, it works in R11.04, so it's certainly relatd to scripts changes.

Maybe some forms I reported below could have also the pb in trunk and R12.04.
ie
>sprintBacklogListItems forms and more in scrumForms.xml

Jacques

From: <[hidden email]>

> Author: jleroux
> Date: Fri May  4 21:46:25 2012
> New Revision: 1334201
>
> URL: http://svn.apache.org/viewvc?rev=1334201&view=rev
> Log:
> A slightly modified patch from Ankit Jain "Error on View Facility Inventory Items Details Page"
> https://issues.apache.org/jira/browse/OFBIZ-4851
>
> Error on https://demo-trunk.ofbiz.apache.org:8443/facility/control/ViewFacilityInventoryItemsDetails Page, when you select Report
> Type - "By Inventory Item" or "By Product" its throwing error.
>
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen component://common/widget/CommonScreens.xml#GlobalDecorator:
> java.lang.IllegalArgumentException: Return value from use-when condition eval was not a Boolean: null [null] on the field
> inventoryItemId of form ListFacilityInventoryItemsDetailsByItem (Return value from use-when condition eval was not a Boolean: null
> [null] on the field inventoryItemId of form ListFacilityInventoryItemsDetailsByItem)
>
> jleroux: I supposed it was related to recent changes on scripts language, but was not sure. So I searched for ${bsh:*
> type="Boolean"/> and found some others of the same kind: in UpdateProductFacilityLocations, FindProject, sprintBacklogListItems
> forms and more in scrumForms.xml. I tried with UpdateProductFacilityLocations & FindProject but surprisingly did not reproduce the
> problem. At this stage I gave up...
>
> Sligth changes from Ankit's patch: I simply used real ' instead of &quot; and reformatted to make things more legible
>
> Modified:
>    ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
>
> Modified: ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1334201&r1=1334200&r2=1334201&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml (original)
> +++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Fri May  4 21:46:25 2012
> @@ -229,7 +229,7 @@ under the License.
>             </service>
>         </actions>
>         <row-actions>
> -            <set field="showPosition1" value="${bsh:String prev=(String)previousItem.get(&quot;inventoryItemId&quot;);return new
> Boolean(!(prev!=null&amp;&amp;prev.equals(inventoryItemId)));}" type="Boolean"/>
> +            <set field="showPosition1" value="${groovy: String prev = (String) previousItem.get('inventoryItemId');return new
> Boolean(!(prev!=null &amp;&amp; prev.equals(inventoryItemId)));}" type="Boolean"/>
>         </row-actions>
>
>         <field name="inventoryItemId" widget-style="buttontext" position="1" use-when="showPosition1">
> @@ -293,7 +293,7 @@ under the License.
>             </service>
>         </actions>
>         <row-actions>
> -            <set field="showPosition1" value="${bsh:String prev=(String)previousItem.get(&quot;productId&quot;);return new
> Boolean(!(prev!=null&amp;&amp;prev.equals(productId)));}" type="Boolean"/>
> +            <set field="showPosition1" value="${groovy:String prev = (String) previousItem.get('productId'); return new
> Boolean(!(prev!=null &amp;&amp; prev.equals(productId)));}" type="Boolean"/>
>         </row-actions>
>
>         <field name="productId" position="1" use-when="showPosition1" widget-style="buttontext">
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1334201 - /ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml

Adrian Crum-3
This commit does not fix the problem, it only hides the problem. The
correct fix is to get the bsh: evaluation to return the correct result.

-Adrian

On 5/4/2012 10:46 PM, [hidden email] wrote:

> Author: jleroux
> Date: Fri May  4 21:46:25 2012
> New Revision: 1334201
>
> URL: http://svn.apache.org/viewvc?rev=1334201&view=rev
> Log:
> A slightly modified patch from Ankit Jain "Error on View Facility Inventory Items Details Page" https://issues.apache.org/jira/browse/OFBIZ-4851
>
> Error on https://demo-trunk.ofbiz.apache.org:8443/facility/control/ViewFacilityInventoryItemsDetails Page, when you select Report Type - "By Inventory Item" or "By Product" its throwing error.
>
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen component://common/widget/CommonScreens.xml#GlobalDecorator: java.lang.IllegalArgumentException: Return value from use-when condition eval was not a Boolean: null [null] on the field inventoryItemId of form ListFacilityInventoryItemsDetailsByItem (Return value from use-when condition eval was not a Boolean: null [null] on the field inventoryItemId of form ListFacilityInventoryItemsDetailsByItem)
>
> jleroux: I supposed it was related to recent changes on scripts language, but was not sure. So I searched for ${bsh:* type="Boolean"/>  and found some others of the same kind: in UpdateProductFacilityLocations, FindProject, sprintBacklogListItems forms and more in scrumForms.xml. I tried with UpdateProductFacilityLocations&  FindProject but surprisingly did not reproduce the problem. At this stage I gave up...
>
> Sligth changes from Ankit's patch: I simply used real ' instead of&quot; and reformatted to make things more legible
>
> Modified:
>      ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
>
> Modified: ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1334201&r1=1334200&r2=1334201&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml (original)
> +++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Fri May  4 21:46:25 2012
> @@ -229,7 +229,7 @@ under the License.
>               </service>
>           </actions>
>           <row-actions>
> -<set field="showPosition1" value="${bsh:String prev=(String)previousItem.get(&quot;inventoryItemId&quot;);return new Boolean(!(prev!=null&amp;&amp;prev.equals(inventoryItemId)));}" type="Boolean"/>
> +<set field="showPosition1" value="${groovy: String prev = (String) previousItem.get('inventoryItemId');return new Boolean(!(prev!=null&amp;&amp; prev.equals(inventoryItemId)));}" type="Boolean"/>
>           </row-actions>
>
>           <field name="inventoryItemId" widget-style="buttontext" position="1" use-when="showPosition1">
> @@ -293,7 +293,7 @@ under the License.
>               </service>
>           </actions>
>           <row-actions>
> -<set field="showPosition1" value="${bsh:String prev=(String)previousItem.get(&quot;productId&quot;);return new Boolean(!(prev!=null&amp;&amp;prev.equals(productId)));}" type="Boolean"/>
> +<set field="showPosition1" value="${groovy:String prev = (String) previousItem.get('productId'); return new Boolean(!(prev!=null&amp;&amp; prev.equals(productId)));}" type="Boolean"/>
>           </row-actions>
>
>           <field name="productId" position="1" use-when="showPosition1" widget-style="buttontext">
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1334201 - /ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml

Pierre Smits
If that is the case then the JIRA issue should be reopened again, and the
comments posted in this thread should be inserted so that it stays on the
radar to be fixed correctly.

Regards,

Pierre

2012/5/5 Adrian Crum <[hidden email]>

> This commit does not fix the problem, it only hides the problem. The
> correct fix is to get the bsh: evaluation to return the correct result.
>
> -Adrian
>
>
> On 5/4/2012 10:46 PM, [hidden email] wrote:
>
>> Author: jleroux
>> Date: Fri May  4 21:46:25 2012
>> New Revision: 1334201
>>
>> URL: http://svn.apache.org/viewvc?**rev=1334201&view=rev<http://svn.apache.org/viewvc?rev=1334201&view=rev>
>> Log:
>> A slightly modified patch from Ankit Jain "Error on View Facility
>> Inventory Items Details Page" https://issues.apache.org/**
>> jira/browse/OFBIZ-4851 <https://issues.apache.org/jira/browse/OFBIZ-4851>
>>
>> Error on https://demo-trunk.ofbiz.**apache.org:8443/facility/**control/**
>> ViewFacilityInventoryItemsDeta**ils<https://demo-trunk.ofbiz.apache.org:8443/facility/control/ViewFacilityInventoryItemsDetails>Page, when you select Report Type - "By Inventory Item" or "By Product" its
>> throwing error.
>>
>> org.ofbiz.widget.screen.**ScreenRenderException: Error rendering screen
>> component://common/widget/**CommonScreens.xml#**GlobalDecorator:
>> java.lang.**IllegalArgumentException: Return value from use-when
>> condition eval was not a Boolean: null [null] on the field inventoryItemId
>> of form ListFacilityInventoryItemsDeta**ilsByItem (Return value from
>> use-when condition eval was not a Boolean: null [null] on the field
>> inventoryItemId of form ListFacilityInventoryItemsDeta**ilsByItem)
>>
>> jleroux: I supposed it was related to recent changes on scripts language,
>> but was not sure. So I searched for ${bsh:* type="Boolean"/>  and found
>> some others of the same kind: in UpdateProductFacilityLocations**,
>> FindProject, sprintBacklogListItems forms and more in scrumForms.xml. I
>> tried with UpdateProductFacilityLocations**&  FindProject but
>> surprisingly did not reproduce the problem. At this stage I gave up...
>>
>> Sligth changes from Ankit's patch: I simply used real ' instead of&quot;
>> and reformatted to make things more legible
>>
>>
>> Modified:
>>     ofbiz/trunk/applications/**product/widget/facility/**
>> FacilityForms.xml
>>
>> Modified: ofbiz/trunk/applications/**product/widget/facility/**
>> FacilityForms.xml
>> URL: http://svn.apache.org/viewvc/**ofbiz/trunk/applications/**
>> product/widget/facility/**FacilityForms.xml?rev=1334201&**
>> r1=1334200&r2=1334201&view=**diff<http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1334201&r1=1334200&r2=1334201&view=diff>
>> ==============================**==============================**
>> ==================
>> --- ofbiz/trunk/applications/**product/widget/facility/**FacilityForms.xml
>> (original)
>> +++ ofbiz/trunk/applications/**product/widget/facility/**FacilityForms.xml
>> Fri May  4 21:46:25 2012
>> @@ -229,7 +229,7 @@ under the License.
>>              </service>
>>          </actions>
>>          <row-actions>
>> -<set field="showPosition1" value="${bsh:String
>> prev=(String)previousItem.get(**&quot;inventoryItemId&quot;);**return
>> new Boolean(!(prev!=null&amp;&amp;**prev.equals(inventoryItemId)))**;}"
>> type="Boolean"/>
>> +<set field="showPosition1" value="${groovy: String prev = (String)
>> previousItem.get('**inventoryItemId');return new
>> Boolean(!(prev!=null&amp;&amp; prev.equals(inventoryItemId)))**;}"
>> type="Boolean"/>
>>
>>          </row-actions>
>>
>>          <field name="inventoryItemId" widget-style="buttontext"
>> position="1" use-when="showPosition1">
>> @@ -293,7 +293,7 @@ under the License.
>>              </service>
>>          </actions>
>>          <row-actions>
>> -<set field="showPosition1" value="${bsh:String
>> prev=(String)previousItem.get(**&quot;productId&quot;);return new
>> Boolean(!(prev!=null&amp;&amp;**prev.equals(productId)));}"
>> type="Boolean"/>
>> +<set field="showPosition1" value="${groovy:String prev = (String)
>> previousItem.get('productId'); return new Boolean(!(prev!=null&amp;&amp;
>> prev.equals(productId)));}" type="Boolean"/>
>>
>>          </row-actions>
>>
>>          <field name="productId" position="1" use-when="showPosition1"
>> widget-style="buttontext">
>>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1334201 - /ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml

Ankit Jain-2
In reply to this post by Adrian Crum-3
Hi Adrian,

I looked into it and found that if I am using "==" instead of
".equals" it works fine for bsh also , I am not sure its because of
Script changes or not.

But if I am using ".equals" than I am getting the below error on
console and its saying that error in running bsh script.


2012-05-05 16:27:05,217 (http-bio-0.0.0.0-8443-exec-16) [
ScriptUtil.java:282:WARN ]
---- exception report ----------------------------------------------------------
Error running bsh script [String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(prev!=null&&prev.equals(inventoryItemId)));]:
javax.script.ScriptException: Sourced file: inline evaluation of:
``String prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' : Attempt to resolve method: equals() on
undefined variable or class name: prev : at Line: 1 : in file: inline
evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' : prev .equals ( inventoryItemId )
 in inline evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' at line number 1
Exception: javax.script.ScriptException
Message: Sourced file: inline evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' : Attempt to resolve method: equals() on
undefined variable or class name: prev : at Line: 1 : in file: inline
evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' : prev .equals ( inventoryItemId )
 in inline evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' at line number 1
---- stack trace ---------------------------------------------------------------
javax.script.ScriptException: Sourced file: inline evaluation of:
``String prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' : Attempt to resolve method: equals() on
undefined variable or class name: prev : at Line: 1 : in file: inline
evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' : prev .equals ( inventoryItemId )
 in inline evaluation of: ``String
prev=(String)previousItem.get("inventoryItemId");return new
Boolean(!(pre . . . '' at line number 1
bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:92)
bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
org.ofbiz.base.util.ScriptUtil.evaluate(ScriptUtil.java:279)




Regards,
Ankit Jain



On Sat, May 5, 2012 at 2:32 PM, Adrian Crum
<[hidden email]> wrote:

> This commit does not fix the problem, it only hides the problem. The correct
> fix is to get the bsh: evaluation to return the correct result.
>
> -Adrian
>
>
> On 5/4/2012 10:46 PM, [hidden email] wrote:
>>
>> Author: jleroux
>> Date: Fri May  4 21:46:25 2012
>> New Revision: 1334201
>>
>> URL: http://svn.apache.org/viewvc?rev=1334201&view=rev
>> Log:
>> A slightly modified patch from Ankit Jain "Error on View Facility
>> Inventory Items Details Page"
>> https://issues.apache.org/jira/browse/OFBIZ-4851
>>
>> Error on
>> https://demo-trunk.ofbiz.apache.org:8443/facility/control/ViewFacilityInventoryItemsDetails
>> Page, when you select Report Type - "By Inventory Item" or "By Product" its
>> throwing error.
>>
>> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
>> component://common/widget/CommonScreens.xml#GlobalDecorator:
>> java.lang.IllegalArgumentException: Return value from use-when condition
>> eval was not a Boolean: null [null] on the field inventoryItemId of form
>> ListFacilityInventoryItemsDetailsByItem (Return value from use-when
>> condition eval was not a Boolean: null [null] on the field inventoryItemId
>> of form ListFacilityInventoryItemsDetailsByItem)
>>
>> jleroux: I supposed it was related to recent changes on scripts language,
>> but was not sure. So I searched for ${bsh:* type="Boolean"/>  and found some
>> others of the same kind: in UpdateProductFacilityLocations, FindProject,
>> sprintBacklogListItems forms and more in scrumForms.xml. I tried with
>> UpdateProductFacilityLocations&  FindProject but surprisingly did not
>> reproduce the problem. At this stage I gave up...
>>
>> Sligth changes from Ankit's patch: I simply used real ' instead of&quot;
>> and reformatted to make things more legible
>>
>>
>> Modified:
>>     ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
>>
>> Modified:
>> ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1334201&r1=1334200&r2=1334201&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
>> (original)
>> +++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Fri
>> May  4 21:46:25 2012
>> @@ -229,7 +229,7 @@ under the License.
>>              </service>
>>          </actions>
>>          <row-actions>
>> -<set field="showPosition1" value="${bsh:String
>> prev=(String)previousItem.get(&quot;inventoryItemId&quot;);return new
>> Boolean(!(prev!=null&amp;&amp;prev.equals(inventoryItemId)));}"
>> type="Boolean"/>
>> +<set field="showPosition1" value="${groovy: String prev = (String)
>> previousItem.get('inventoryItemId');return new
>> Boolean(!(prev!=null&amp;&amp; prev.equals(inventoryItemId)));}"
>> type="Boolean"/>
>>
>>          </row-actions>
>>
>>          <field name="inventoryItemId" widget-style="buttontext"
>> position="1" use-when="showPosition1">
>> @@ -293,7 +293,7 @@ under the License.
>>              </service>
>>          </actions>
>>          <row-actions>
>> -<set field="showPosition1" value="${bsh:String
>> prev=(String)previousItem.get(&quot;productId&quot;);return new
>> Boolean(!(prev!=null&amp;&amp;prev.equals(productId)));}" type="Boolean"/>
>> +<set field="showPosition1" value="${groovy:String prev = (String)
>> previousItem.get('productId'); return new Boolean(!(prev!=null&amp;&amp;
>> prev.equals(productId)));}" type="Boolean"/>
>>
>>          </row-actions>
>>
>>          <field name="productId" position="1" use-when="showPosition1"
>> widget-style="buttontext">
>>
>>
>