After a lot of monkeying around I got this to work and learned two things:
1. I had to specify the implementation class name (FulfillmentGroupImpl) rather than the interface...even though for Order it was OK to specify the interface.
2. I had to disable 'readOnly' on each individual attribute of Address, PersonalMessage, etc. that I wanted to make editable
I'm not sure why this is but suspect it has something to do with the fulfillment groups being associations to the top-level thing I am editing (
Order) and there is also this:
https://github.com/BroadleafCommerce/BroadleafCommerce/issues/138. It's worth pointing out that if you override the entities and use annotations it is not necessary to specify all the individual fields. You can, for example, just specify that the Address is not read only and it works as expected.
Here's the final XML that worked for me, next stop is figuring out how to override the admin save request mapping so we can do something when people update the
order info:
Code: Select all
<mo:override id="blMetadataOverrides">
<mo:overrideItem ceilingEntity="org.broadleafcommerce.core.order.domain.Order">
<mo:field name="fulfillmentGroups">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="status">
<mo:property name="broadleafEnumeration" value="com.mystore.order.service.type.MyOrderStatus" />
<mo:property name="readOnly" value="false" />
</mo:field>
</mo:overrideItem>
<mo:overrideItem ceilingEntity="org.broadleafcommerce.core.order.domain.FulfillmentGroupImpl">
<mo:field name="address.firstName">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.lastName">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.emailAddress">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.companyName">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.addressLine1">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.addressLine2">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.addressLine3">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.city">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.state">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.county">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.country">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.postalCode">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.zipFour">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.phonePrimary.phoneNumber">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.phoneSecondary.phoneNumber">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="address.phoneFax.phoneNumber">
<mo:property name="readOnly" value="false" />
</mo:field>
<mo:field name="personalMessage.message">
<mo:property name="readOnly" value="false" />
</mo:field>
</mo:overrideItem>
</mo:override>