OFBiz
  1. OFBiz
  2. OFBIZ-5125

No states displayed for default country in New Shipping Address for order

    Details

      Description

      On the demo site, go to https://demo-trunk.ofbiz.apache.org/ordermgr/control/orderview?orderId=WSCO10001 and click on New Shipping Address. No states are displayed for the default country, USA. Once you choose a country, states are displayed properly.

      Have a look at the pattern used elsewhere in OFBiz in framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl (https://fisheye6.atlassian.com/browse/ofbiz/trunk/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl). A change event calls a function, in this case getDependentDropdownValues, and there's a call to the function to set an initial value for the dependent value based on the default value of the source data.

      Compare the code in https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js, which sets up the change event but does not set a default value. The patch includes a call to getAssociatedStateList to fix the problem.

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          8m 20s 1 Paul Foxworthy 12/Jan/13 04:09
          Patch Available Patch Available Resolved Resolved
          47d 9h 59m 1 Paul Foxworthy 28/Feb/13 14:09
          Resolved Resolved Closed Closed
          3h 33m 1 Jacques Le Roux 28/Feb/13 17:43
          Paul Foxworthy made changes -
          Link This issue is duplicated by OFBIZ-5014 [ OFBIZ-5014 ]
          Jacques Le Roux made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Jacques Le Roux added a comment -

          Please Paul, close issues once done (it's our policy) thanks :)0

          Show
          Jacques Le Roux added a comment - Please Paul, close issues once done (it's our policy) thanks :)0
          Paul Foxworthy made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Fix Version/s Release Branch 11.04 [ 12316420 ]
          Fix Version/s SVN trunk [ 12311928 ]
          Fix Version/s Release Branch 12.04 [ 12321265 ]
          Resolution Fixed [ 1 ]
          Hide
          Paul Foxworthy added a comment -

          Committed to trunk in rev 1451195
          11.04 1451198
          12.04 1451203

          10.04 predates jQuery and doesn't have this problem

          Show
          Paul Foxworthy added a comment - Committed to trunk in rev 1451195 11.04 1451198 12.04 1451203 10.04 predates jQuery and doesn't have this problem
          Hide
          Jacques Le Roux added a comment -

          Hi Paul,

          Thanks to take setDependentDropdownValuesJs as a reference . I agree on the fix.

          Show
          Jacques Le Roux added a comment - Hi Paul, Thanks to take setDependentDropdownValuesJs as a reference . I agree on the fix.
          Paul Foxworthy made changes -
          Description On the demo site, go to https://demo-trunk.ofbiz.apache.org/ordermgr/control/orderview?orderId=WSCO10001 and click on New Shipping Address. No states are displayed for the default country, USA. Once you choose a country, states are displayed properly.

          Have a look at the pattern used elsewhere in OFBIZ in framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl (https://fisheye6.atlassian.com/browse/ofbiz/trunk/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl). A change event calls a function, in this case getDependentDropdownValues, and there's a call to the function to set an initial vale for the dependent value based on the default value of the source data.

          Compare the code in https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js, which sets up the change event but does not set a default value. The patch includes a call to getAssociatedStateList to fix the problem.

           
          On the demo site, go to https://demo-trunk.ofbiz.apache.org/ordermgr/control/orderview?orderId=WSCO10001 and click on New Shipping Address. No states are displayed for the default country, USA. Once you choose a country, states are displayed properly.

          Have a look at the pattern used elsewhere in OFBiz in framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl (https://fisheye6.atlassian.com/browse/ofbiz/trunk/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl). A change event calls a function, in this case getDependentDropdownValues, and there's a call to the function to set an initial value for the dependent value based on the default value of the source data.

          Compare the code in https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/images/js/OrderShippingInfo.js, which sets up the change event but does not set a default value. The patch includes a call to getAssociatedStateList to fix the problem.

           
          Paul Foxworthy made changes -
          Attachment OFBIZ-5125_initial_state_list [ 12564548 ]
          Paul Foxworthy made changes -
          Field Original Value New Value
          Status Open [ 1 ] Patch Available [ 10002 ]
          Paul Foxworthy created issue -

            People

            • Assignee:
              Paul Foxworthy
              Reporter:
              Paul Foxworthy
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development