Description of problem: If I have a dynamic drop down that sets a default option the default option shows up fine in the traditional OPs UI but in the Self Service UI the default is not selected. Version-Release number of selected component (if applicable): 5.7.1 5.7.2.1.20170406142927_0a1ad0e How reproducible: Always Steps to Reproduce: 1. Create a dynamic drop down with default option 2. order service catalog item with dynamic drop down in self service UI Actual results: Default is not selected, no option is selected. Expected results: Specified default option should be selected.
Can you send me a copy of the dialog you created and also point me to the appliance you tested this on? I am unable to reproduce this locally and these two things would help me to determine if this is reproducible.
Created attachment 1272136 [details] dialog
Created attachment 1272137 [details] self service - no defaults
Created attachment 1272138 [details] ops ui - defaults work
Created attachment 1272139 [details] one example of the method populating one of the dynamic drop downs
@Chris, I have attached what I think you were asking for. Let me know if you need more. Blue skies, Ian
Ian, The method you attached does not have a default value set for the dropdown based on the code you sent. I have tested a dynamic dropdown locally where I set the default_value in ruby code that defines that dynamic dropdown. The SUI does recognize this if it is set.
Created attachment 1272143 [details] Setting of Defaults
Could you test out modifying your dropdown to define a default similar to how I have attached and see if that sets the default that you had defined
@Chris, Should the default value be the key or the value from the hash? It is unclear from your example since both key and value are the same string. Then, also assuming this works, why do I need to set this for Self Service but for the OPS UI the behavior is to select the first option in the list? That is inconsistent.
``` dialog_field = $evm.object dialog_field["sort_by"] = "value" dialog_field["sort_order"] = "ascending" dialog_field["data_type"] = "integer" dialog_field["required"] = true dialog_field['default_value'] = organization_index['results'][0]['id'] dialog_field["values"] = Hash[ *organization_index['results'].collect { |item| [item['id'], item['label']] }.flatten ] ``` That still doesn't work.
Ian, If its possible to give me access to the appliance you are experiencing this issue on , it would help me to take a look and see what the API is returning for this drop down.
Chris, I sent you an email with the log in info for the internal lab.
GH PR https://github.com/ManageIQ/manageiq-ui-service/pull/692
@Chris, For my own edification, what was the issue? I looked at the pull request, was it something to do with having an int value rathe rather then a string value?
Fixed in 5.9.0.4.20171024163837_ef71ea6