A slightly modified patch from Christian Carlow for "Incorrect selected ship destination displayed on purchase order entry form" https://issues.apache.org/jira/browse/OFBIZ-5397

Selected ship group destinations are displayed incorrectly on the purchase order entry Shipping page.  The first ship group destination is selected without checking if any of the other destinations were selected.  Part of the problem is that the facilityId of the destination chosen is not specified in the parameters passed to CheckOutEvents finalizeOrderEntry function.

To reproduce:
1.  Create an order to DemoSupplier
2.  Add any supplier product to the order and click Finalize Order
3.  Click Continue until you reach the Shipping page
4.  Choose the second shipping destination and click Continue
5.  Click the Shipping link to go back to the previous shipping page
6.  Notice that the second destination is not selected

The second destination is actually assigned because it appears on the confirmation page but no code exists to check the correct radio option.  The facilityId will have to be passed in somehow to allow such logic to be correctly implemented.

Using the @ symbol probably isn't the best one to use for separating fields. I wanted to provide the facility destination contactMechIds in a drop down list rather than as a list of radio options and when the @ symbol is used, it is encoded as @ which prevents matching of the key. This means that I don't get an accurate description in the drop down list of the selected record. Replacing the @ symbol with something else such as _ fixes the issue but might cause problems if some facilities or contactMechIds contain an _.

jleroux:I simply used the token _@_ as separator to prevent wrong splits in case @ or _ would have been used in facilities or contactMechIds (though it's not possible OOTB from UI, those Ids are generated)
This solution works well with radio buttons. There are a lof of information to show in each ship group address and I believe in such case it's easier to read as it's currently done (multiple lines for each address) than using a drop-down.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1544444 13f79535-47bb-0310-9956-ffa450edef68