You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Olivier Heintz (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/12/13 18:34:30 UTC

[jira] [Issue Comment Edited] (OFBIZ-4487) enable definition for position on sortfield

    [ https://issues.apache.org/jira/browse/OFBIZ-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145825#comment-13145825 ] 

Olivier Heintz edited comment on OFBIZ-4487 at 12/13/11 5:33 PM:
-----------------------------------------------------------------

Erwan,

It's correct that it's not the same ouput.
in case one there is no field with position="1" so it's put in first column

It's exactly the same without the patch without extend
if you test with
    <form name="FindExamples" type="single" target="FindExample" default-entity-name="Example">
        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
        <field name="exampleId" title="${uiLabelMap.ExampleExampleId}"><text-find/></field>
        <field name="exampleName" title="${uiLabelMap.CommonName}"><text-find/></field>
        <field name="exampleTypeId" title="${uiLabelMap.CommonType}">
            <drop-down allow-empty="true" current-description="">
                <entity-options description="${description}" key-field-name="exampleTypeId" entity-name="ExampleType">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="statusId" title="${uiLabelMap.CommonStatus}" position="2">
            <drop-down allow-empty="true" current-description="">
                <entity-options description="${description}" key-field-name="statusId" entity-name="ExampleStatusItem"/>
            </drop-down>
        </field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button" image-location="/images/icons/magnifier.png"/></field>
        <sort-order>
            <field-group>
                <sort-field name="exampleId"/>
                <sort-field name="exampleName"/>
            </field-group>
            <field-group>
                <sort-field name="exampleTypeId"/>
                <sort-field name="statusId"/>
            </field-group>
            <sort-field name="searchButton"/>
        </sort-order>
    </form>

you will see.

But there is still a other problem with the proposed patch
the defaut position in sort field (if there is nothing, it's 1) override the position which is given in field.
It's not correct, it should override only if value is given for position in sortfield.

I have corrected this problem and created a new patch sortFieldPosition2.patch.
so, now, with this new patch 
all seem correct for me.

                
      was (Author: holivier):
    Erwan,

It's correct that it's not the same ouput.
in case one there is no field with position="1" so it's put in first column

It's exactly the same without the patch without extend
if you test with
    <form name="FindExamples" type="single" target="FindExample" default-entity-name="Example">
        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
        <field name="exampleId" title="${uiLabelMap.ExampleExampleId}"><text-find/></field>
        <field name="exampleName" title="${uiLabelMap.CommonName}"><text-find/></field>
        <field name="exampleTypeId" title="${uiLabelMap.CommonType}">
            <drop-down allow-empty="true" current-description="">
                <entity-options description="${description}" key-field-name="exampleTypeId" entity-name="ExampleType">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="statusId" title="${uiLabelMap.CommonStatus}" position="2">
            <drop-down allow-empty="true" current-description="">
                <entity-options description="${description}" key-field-name="statusId" entity-name="ExampleStatusItem"/>
            </drop-down>
        </field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button" image-location="/images/icons/magnifier.png"/></field>
        <sort-order>
            <field-group>
                <sort-field name="exampleId"/>
                <sort-field name="exampleName"/>
            </field-group>
            <field-group>
                <sort-field name="exampleTypeId"/>
                <sort-field name="statusId"/>
            </field-group>
            <sort-field name="searchButton"/>
        </sort-order>
    </form>

you will see.

But there is still a other problem with the proposed patch
the defaut position in sort field (if there is nothing, it's 1) override the position which is given in field.
It's not correct, it should override only if value is given for position in sortfield.

so, with the new patch all seem correct for me.
                  
> enable definition for position on sortfield
> -------------------------------------------
>
>                 Key: OFBIZ-4487
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4487
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: youssef khaye
>         Attachments: OFBIZ-4487-1.png, OFBIZ-4487-2.png, sortFieldPosition-exampleForms.patch, sortFieldPosition.patch, sortFieldPosition2.patch
>
>
> in some cases, form extending another one, it may be convenient to be able to define field position on the sort field element.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira