[
https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527341
]
Jonathon Wong commented on OFBIZ-1130:
--------------------------------------
Hi Wickersheimer Jeremy,
findServices.patch tested and reviewed.
Refactoring is perfectly clean, no functional changes. List value handling
tested to work.
Questions about htmlFormRenderer.patch ...
For checkbox values, are you sure that the values come in String(s) and not in
List(s)?
2 areas to consider here:
1. From parameters. Say when a form is submitted, and an error occurs, and the
checkboxes need to be repopulated with last entered values.
2. From DB. How will checkbox fields be stored in DB?
For area 1, I have tested the value type to be of ArrayList (or List), and not
String. Note how ModelFormField.getEntry() will crash.
> 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, htmlFormRenderer.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.