Bug 1380504 - Dynamic Text Box set with a default value will ignore the value returned by the dynamic method
Summary: Dynamic Text Box set with a default value will ignore the value returned by t...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: cfme-future
Assignee: eclarizi
QA Contact: Dmitry Misharov
URL:
Whiteboard: automate:dialog:ui
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-29 19:10 UTC by Jerome Marc
Modified: 2018-06-11 13:57 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-08 14:04:27 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
dluong: needinfo-


Attachments (Terms of Use)

Description Jerome Marc 2016-09-29 19:10:06 UTC
Description of problem:
I have a Service Dialog with a Text Box on it.
When a Default Value is set, this will override any result returned by the dynamic method (specified by the Entry Point). Shouldn't this be the other way round?

Version-Release number of selected component (if applicable):
5.6.1.2.20160810181333_8ba817b

How reproducible:
Always

Steps to Reproduce:
1. Create a Service Dialog and associate it to a button on a VM
2. On the dialog, create a Text Box and set a default value
3. Click Dynamic and set an Entry Point method (example bellow)
4. From the VM screen, click on the button

Actual results:
The field will be populated with the default value, ignoring your Dynamic method result.

Expected results:
The default value should be overriden by the value returned by the Dynamic method

Additional info:
When removing the default value from the field, the field is populated with the result from the Dynamic method.

Example of a dynamic method (used to return the VM in context to populate the limit field):

vm_name = $evm.root['dialog_vm_name']
if vm_name.nil? || vm_name.length.zero?
    unless $evm.root['vm'].nil?
	    vm_name = $evm.root['vm'].name
    end
end

unless vm_name.nil? || vm_name.length.zero?
	limit = $evm.object
	limit["data_type"] = "string"
	limit["required"] = "true"
	limit["value"] = vm_name
end

Comment 2 Greg McCullough 2016-10-06 16:08:13 UTC
Jerome - Sounds like removing the default_value from the field setup is a valid work-around for this issue.

You can also set the 'default_value' key as part of the automate method, have you tried using that if you need a default?

Comment 3 Jerome Marc 2016-11-08 00:50:00 UTC
I don't seem to be able to access default_value from Automate for this element using: $evm.object["default_value"]

Comment 5 Tina Fitzgerald 2018-05-24 21:46:32 UTC
We think issue has been fixed with latest PRs. Waiting for QE to validate.

Comment 6 Dmitry Misharov 2018-05-25 14:00:26 UTC
Tested on master.20180518005611_6f8f0cd. The issue is not fixed there.

Comment 7 Dmitry Misharov 2018-05-25 14:29:28 UTC
Tested on master.20180525014609_98ef65d. The issue is still not fixed there.

Comment 8 Dmitry Misharov 2018-05-25 14:33:30 UTC
Actually I don't see an issue here. Default value is located in "Overridable Options" tab. From my perspective any values entered there should override other tabs vaues, isn't it?

Comment 9 Tina Fitzgerald 2018-05-25 14:51:22 UTC
Hi Dmitry,

Can I access your test environment?

Thanks,
Tina

Comment 13 drew uhlmann 2018-06-08 13:05:25 UTC
Hey Dmitry! I agree with you about this not being a bug. You can either run the values from the automate method, or you can override with a default in the editor settings.

Comment 14 Dmitry Misharov 2018-06-08 14:04:27 UTC
Closed as not a bug.


Note You need to log in before you can comment on or make changes to this bug.