[ https://issues.apache.org/jira/browse/OFBIZ-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507656 ]
Jacopo Cappellato commented on OFBIZ-1075: ------------------------------------------ David, all, I've committed my work in rev. 550168. The main differences from what I have described in this issue are: 1) at the end I've not changed the position attribute from positiveInteger to integer; 2) as a consequence I've suppressed (from my previous patch) the concept of the main (default) position (position="1"): positions are rendered as rows sorted by position (starting from 1); 3) the same happens for the header (I've implemented what David suggested) 4) I've added code, but for now it is commented out, to suppress an header for a field: the idea is that, if in a "field" element the title is explicitly set to "" (title="") then no cell will be created for the fields in the header; this is disabled for now because there are a lot of form definitions that are setting the title to "" in order to display an empty header: if we will move in this direction we will need to change them to title=" "; is this acceptable? For more details see the commit log. > Implemented support for "position" attributes in fields of forms of type > "list" and "multi". > -------------------------------------------------------------------------------------------- > > Key: OFBIZ-1075 > URL: https://issues.apache.org/jira/browse/OFBIZ-1075 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Jacopo Cappellato > Assignee: Jacopo Cappellato > Priority: Minor > Attachments: formlist-position.patch, list-standard.jpg, > list-with-positions.jpg, position-list-example.diff, productprice.jpg, > productprice.patch > > > With the attached patch (formlist-position.patch) I've implemented support > for "position" attributes in fields of forms of type "list" and "multi". > The main concept is that, if in a form widget definition of type > "list"/"multi", the fields have different positions then they are rendered > into separate rows. > The main (default) position is 1, and the column (titles) are only the ones > for the fields in this group. > The fields in positions < 1 are rendered in rows before the main one; the > fields in positions > 1 are rendered after. > As a proof of concept (so that you can understand how the positions can be > used in lists), I've applied it to the currency field in the "product price > list" form (see the patch productprice.patch and the image productprice.jpg) > To all the reviewers: > I'd like to get your comments and reviews most of all to the two main changes > introduced by this patch: > 1) in widget-form.xsd: the type of the element "position" has been changed > from "xs:positiveInteger" to "xs:integer" > 2) in the interface "FormStringRenderer": the method > "renderFormatItemRowCellOpen" has now a new parameter (int positionSpan) > All the other changes (most of all to the ModelForm class) are just: > 1) refactoring of existing methods; I have separated into different methods > the field processing logic (eval on use-when etc) from the rendering > (buffer.append etc..); to make the code cleaner, more flexible and easier to > read > 2) bug fixes (I can provide more details here, if you want) > 3) added comments > What do you think? > I'm testing everything right now and I'd like to commit this stuff very soon. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.