[jira] [Created] (OFBIZ-5396) Add ability to set <drop-down>, <radio>, <check> form widget field key values manually

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-5396) Add ability to set <drop-down>, <radio>, <check> form widget field key values manually

Nicolas Malin (Jira)
Christian Carlow created OFBIZ-5396:
---------------------------------------

             Summary: Add ability to set <drop-down>, <radio>, <check> form widget field key values manually
                 Key: OFBIZ-5396
                 URL: https://issues.apache.org/jira/browse/OFBIZ-5396
             Project: OFBiz
          Issue Type: New Feature
    Affects Versions: SVN trunk
            Reporter: Christian Carlow


OFBiz should allow for the ability set <drop-down>, <radio>, and <check> form widget fields key values manually for <list-options> and <entity-options>.  Currently the key-field-name attribute of <entity-options> and <list-options> is the only way it can be set and the value must be set to the name of a single entity or list field.  

I am trying to improve the order entry shipment settings forms and wanted to create a <drop-down> form widget field to replace the list of radio options with values ${shipmentMethodTypeId}@${partyId} on the Ship Options page of Order Entry.  The problem is that the key-field-name attribute mentioned above is insufficient for handling such a "multi-key" value.

Adding something such as a "key-value" attribute could allow for manual assignment of the <option> value attributes.  

Lookup fields are also weak when it comes to multi-key entities.  A while back I posted about not being able to create a lookup for order items because of the OrderId, OrderItemSeqId multi-key: OFBIZ-5356

As work around to this problem I create a view-entity of an entity with the primary key being set to a concatenated string of the primary keys.  For example, to allow for a lookup field that provides a list of OrderItems I would create:
<view-entity entity-name="OrderItemOnePrimKey" package-name="org.ofbiz.order.order">
    <member-entity entity-alias="OI" entity-name="OrderItem"></member-entity>
    <alias-all entity-alias="OI" />
    <alias name="orderItemId" prim-key="orderItemId">
    <complex-alias operator="||">
       <complex-alias-field entity-alias="OI" field="orderId" />
       <complex-alias-field value="'_pk_'"/>
       <complex-alias-field entity-alias="OI" field="orderItemSeqId"/>
    </complex-alias>
    </alias>
</view-entity>

Having to do this for every entity with more than one key is redundant.  The keys should be able to be set manually if need be.



--
This message was sent by Atlassian JIRA
(v6.1#6144)