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:20:04 UTC

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

 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


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.


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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux updated OFBIZ-1130:
-----------------------------------

    Summary:  Forms widget : <check ...> support incomplete  (was:  Froms <check ...> support incomplete)

>  Forms widget : <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
>            Assignee: Jacques Le Roux
>         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.


[jira] Reopened: (OFBIZ-1130) Forms widget : support incomplete

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reopened OFBIZ-1130:
------------------------------------


When closing this issue last week I forgot it was needed by OFBIZ-1124 and I'd like to give it a try... somedays...

>  Forms widget : <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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         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.


[jira] Closed: (OFBIZ-1130) Forms widget : support incomplete

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-1130.
----------------------------------

       Resolution: Incomplete
    Fix Version/s: SVN trunk

Without an update these patches are unusable (can't be merged)

>  Forms widget : <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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         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.


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

Posted by "Wickersheimer Jeremy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: htmlFormRenderer.patch

Patch for the HtmlFormRenderer renderCheckField() method.
It just adds a test on the value, if it looks like a List (something like : [val1, val2, ..] ) then it transform it back into a list, iterate the values and select the checkbox if a match is found. 

It should not affect the previous behavior at all, unless a field could have as value both:
- "val"
- "[val]"
Then it will select the two of them when only one was given. 
We could add a test and skip the list processing of there is only one value in the list but I think it is not needed .


>  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.


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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547467 ] 

Jacques Le Roux commented on OFBIZ-1130:
----------------------------------------

Hi commiters,

I think we should put some attention in this, before all is too old and lost... Any help welcome

>  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.


[jira] Closed: (OFBIZ-1130) Forms widget : support incomplete

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-1130.
----------------------------------

    Resolution: Incomplete

>  Forms widget : <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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         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.


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

Posted by "Jonathon Wong (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-1130:
--------------------------------------

    Assignee: Jacques Le Roux

>  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
>            Assignee: Jacques Le Roux
>         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.


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

Posted by "Wickersheimer Jeremy (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Wickersheimer Jeremy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527391 ] 

Wickersheimer Jeremy commented on OFBIZ-1130:
---------------------------------------------

I know it is not used, it was not working before the patch :D

>  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.


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

Posted by "Jonathon Wong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527401 ] 

Jonathon Wong commented on OFBIZ-1130:
--------------------------------------

Hi Wickersheimer Jeremy,

Very well, I take it that you're not interested in pursuing this issue anymore?

I would recommend that your findServices.java patch be committed. And let that be a step in the right direction towards supporting <check>. It's still a very incomplete implementation, though, given my prior observations.

Committers, any thoughts?

>  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.


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

Posted by "Jonathon Wong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527390 ] 

Jonathon Wong commented on OFBIZ-1130:
--------------------------------------

I don't see <check> (checkboxes) being used very much in OFBiz right now.

So do you want your patch committed or not? If not, maybe tell somebody to close this issue?

>  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.


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

Posted by "Wickersheimer Jeremy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527358 ] 

Wickersheimer Jeremy commented on OFBIZ-1130:
---------------------------------------------

Hi,

Wow, i wrote this a long time ago. I used it only in one place and not for storing something in the database so i don't know.
But if other people need it for that, they can improve it.

>  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.