Get first from list tag in screen's and form's action tag.
---------------------------------------------------------- Key: OFBIZ-4379 URL: https://issues.apache.org/jira/browse/OFBIZ-4379 Project: OFBiz Issue Type: New Feature Components: framework Affects Versions: Release 10.04, SVN trunk Reporter: Ankit Jain Priority: Minor Fix For: Release Branch 10.04, SVN trunk In most of the cases we need to get first record from a list in screen and form widgets then we have to do something like this: for eg: <set field="websiteContent" value="${groovy: org.ofbiz.entity.util.EntityUtil.getFirst(websiteContentList);}"/> Instead of using like this my idea is to add a tag like <first-from-list/> in Screen & Form widget's action tag, so one can easily get first record from a list. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ https://issues.apache.org/jira/browse/OFBIZ-4379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092927#comment-13092927 ] David E. Jones commented on OFBIZ-4379: --------------------------------------- Why not just use the [] syntax to get the first element? In other words, something like: <set field="websiteContent" from-field="websiteContentList[0]"/> > Get first from list tag in screen's and form's action tag. > ---------------------------------------------------------- > > Key: OFBIZ-4379 > URL: https://issues.apache.org/jira/browse/OFBIZ-4379 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: Release 10.04, SVN trunk > Reporter: Ankit Jain > Priority: Minor > Fix For: Release Branch 10.04, SVN trunk > > > In most of the cases we need to get first record from a list in screen and form widgets then we have to do something like this: > for eg: > <set field="websiteContent" value="${groovy: org.ofbiz.entity.util.EntityUtil.getFirst(websiteContentList);}"/> > Instead of using like this my idea is to add a tag like <first-from-list/> in Screen & Form widget's action tag, so one can easily get first record from a list. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ankit Jain updated OFBIZ-4379: ------------------------------ Attachment: OFBIZ-4379.patch Attaching patch for this feature. > Get first from list tag in screen's and form's action tag. > ---------------------------------------------------------- > > Key: OFBIZ-4379 > URL: https://issues.apache.org/jira/browse/OFBIZ-4379 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: Release 10.04, SVN trunk > Reporter: Ankit Jain > Priority: Minor > Fix For: Release Branch 10.04, SVN trunk > > Attachments: OFBIZ-4379.patch > > > In most of the cases we need to get first record from a list in screen and form widgets then we have to do something like this: > for eg: > <set field="websiteContent" value="${groovy: org.ofbiz.entity.util.EntityUtil.getFirst(websiteContentList);}"/> > Instead of using like this my idea is to add a tag like <first-from-list/> in Screen & Form widget's action tag, so one can easily get first record from a list. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13093047#comment-13093047 ] Ankit Jain commented on OFBIZ-4379: ----------------------------------- Hello David, I agree with what you say, and yes we can use your suggested way, but this tag is also present in the services, so a point came in my mind why we can't use the same tag in screens and forms. That's why created a patch for it. HTH :) > Get first from list tag in screen's and form's action tag. > ---------------------------------------------------------- > > Key: OFBIZ-4379 > URL: https://issues.apache.org/jira/browse/OFBIZ-4379 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: Release 10.04, SVN trunk > Reporter: Ankit Jain > Priority: Minor > Fix For: Release Branch 10.04, SVN trunk > > Attachments: OFBIZ-4379.patch > > > In most of the cases we need to get first record from a list in screen and form widgets then we have to do something like this: > for eg: > <set field="websiteContent" value="${groovy: org.ofbiz.entity.util.EntityUtil.getFirst(websiteContentList);}"/> > Instead of using like this my idea is to add a tag like <first-from-list/> in Screen & Form widget's action tag, so one can easily get first record from a list. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato updated OFBIZ-4379: ------------------------------------- Affects Version/s: (was: Release 10.04) Fix Version/s: (was: Release Branch 10.04) (was: SVN trunk) > Get first from list tag in screen's and form's action tag. > ---------------------------------------------------------- > > Key: OFBIZ-4379 > URL: https://issues.apache.org/jira/browse/OFBIZ-4379 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Reporter: Ankit Jain > Priority: Minor > Attachments: OFBIZ-4379.patch > > > In most of the cases we need to get first record from a list in screen and form widgets then we have to do something like this: > for eg: > <set field="websiteContent" value="${groovy: org.ofbiz.entity.util.EntityUtil.getFirst(websiteContentList);}"/> > Instead of using like this my idea is to add a tag like <first-from-list/> in Screen & Form widget's action tag, so one can easily get first record from a list. -- 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 |
Free forum by Nabble | Edit this page |