You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Wickersheimer Jeremy (JIRA)" <ji...@apache.org> on 2007/07/06 07:30:05 UTC

[jira] Updated: (OFBIZ-1130) Froms support incomplete

     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wickersheimer Jeremy updated OFBIZ-1130:
----------------------------------------

    Attachment: findServices.patch

In this patch i refactored the createCondition() method so that it can handle both:
- fieldName => String value
- fieldName => List values

I also separated the logic to create the EntityCondition object into 3 methods according to the type of value that is passed.
- 1 method should keep the old behavior for the normal case where the value is a simple String. This build a EntityExpr object.
- 1 method builds a OR EntityConditionList object if the value given is a List
- 1 method is implementing the "range" case.

As a side effect this makes createCondition() a bit easier on the eye.

>  Froms <check ...> support incomplete
> -------------------------------------
>
>                 Key: OFBIZ-1130
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1130
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Wickersheimer Jeremy
>         Attachments: findServices.patch
>
>
> The check boxes used in forms are not properly supported by the framework. I found out some issues at least with:
> - the performFind defined FindServices.java
> - the renderCheckField() method in HtmlFormRenderer.java
> For example if in a Form of type single i want to use checkboxes to define a filter on a finder Form:
> <check>
>     <entity-options description="${description}" entity-name="StatusItem" key-field-name="statusId">
>         <entity-constraint name="statusTypeId" value="ORDER_STATUS"/>
>         <entity-order-by field-name="description"/>
>     </entity-options>
> </check>
> Then in the list i use performFind :
> <service service-name="performFind" result-map-name="result" result-map-list-name="listIt">
>     <field-map field-name="inputFields" env-name="requestParameters"/>
>     <field-map field-name="entityName" env-name="entityName"/>
> </service>
> There will be an Exception thrown by the createCondition() method in FindServices.java because it expects only ONE value to be given for one field. But using checkboxes (the same problem would occur with a list i think) multiple values could be passed.
> The problems is that in this method there is the assumption that the value is a String (unique value selected) whereas it could be a List (multiple value selected).
> The second issue is in the HtmlFormRenderer, the same assumption is made in the renderCheckField() method to determine whether the checkbox should rendered selected. Here no exception is thrown because the value is a String in all case: either the String representation of the value or the String representation of the List of values ( [val1, val2, ...] )
> I have patches for those two issues.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.