Created attachment 1433433 [details] example datastore Description of problem: I found that a method called from a dynamic dialog element (like textbox / dropdown) does read nil a previous textbox element the first time. If one hits the refresh button on the dynamic dialog element, i can at that moment read the previous textbox element correctly. Version-Release number of selected component (if applicable): CF 4.6 (CFME 5.9.2.4) How reproducible: always Steps to Reproduce: 1. import example automate domain 2. import example service dialog 3. create a generic catalog item with the dialog service dialog provided Actual results: The case use would be a cmdb attribute is fetched to a textbox and that field must be read from a later dynamic dialog element. (this is working with cf 4.5 but i wont work with cf 4.6). The example provided is just a minimal test case. And combining this issue with rhbz 1574633 makes the situation is much much worse. Expected results: a second dialog dynamic element should be able to read the previous textbox element. (the textbox element was set to refresh the later dialog dynamic element).
Created attachment 1433434 [details] example dialog
Created attachment 1433435 [details] automate.log pre and post refresh output for example method
Created attachment 1433436 [details] pre refresh
Created attachment 1433437 [details] post refresh
Just to be clear: For static_txtbox1 the Fields to refresh is set to DYNAMIC TXTBOX2. In this example static_txtbox1 is static, but in the real case it will be dynamic. Thanks in advance.
For dynamic fields usually when the Show Refresh Button is set to true, the dialog editor immediately gives the user the opportunity to show the values on init. I'm looking into why the editor won't show the init values on load for a textbox.
Our ui-components/src/dialog-editor/components/modal-field-template/text-box.html doesn't seem to have an option for loading the values on init if the show_refresh_button is set and I'd guess that it maybe should.
Created attachment 1439682 [details] reproducer dialog screenshot
Regarding comment #9, i certainly cannot select load on init by using the dialog editor. So, it looks that it might be. I attached a screenshot from the dynamic dialog on the dialog editor. I hope this helps. Cheers.
Dynamic text box does not show value without hitting refresh button. "Load value on init " is not displayed for dynamic text box. Not fixed in master.20180525014609_98ef65d
By this "Load value on init " is not displayed for dynamic text box. I mean values are not loaded on init .
On 5.8.4.3.20180515170411_29cc195 I can set up a dynamic text box to load with the values correctly. I think this ticket was due to incorrect setup problems, and should be closed as not a bug. I'm looking into why the attached code didn't work as expected but I think this works when set up right.
Okay just kidding, please disregard the previous comment.
As noted to Ryan, this bug is specific to only mention text boxes, and per https://bugzilla.redhat.com/show_bug.cgi?id=1438763 the default load value for text boxes is blank. This is expected behavior.
Working as designed, closing.
Reopening. This has nothing to do with the default value for textbox. It is about the lack of "load values on init" so a mandatory refresh is needed. This works in CF 4.5 and not in CF 4.6.
Reartes, Ryan's first comment in the bug I linked to is that on load the text box should be blank. This isn't a bug.
Created attachment 1447911 [details] CF 4.5 dialog, CORRECT
Created attachment 1447912 [details] CF 4.6 dialog INCORRECT / BAD / BUG
The "blank" textbox is dynamic, and it is "blank" ATM because "load values on init" is not present (and should be) on the dialog editor. It is a bug in the dialog editor or other part of CF, but it is a bug.
No. We've never had the load values on init on the editor for things that are not sorted dialog field items. Text boxes should not should load values on init option. They don't. That particular thing isn't a bug either.
Ok. Can you elaborate "not sorted dialog field items" a bit. I re-checked and neither load values on init (ok to not to be, according to comment 27) nor auto-refresh can be selected on the dialog editor (4.6). CF 4.6 has targeted refresh, so i know the refresh logic changed somehow. But even then textbox1 was set (tried both set/unset) to refresh textbox2, the textbox2 does not auto refresh automatically. It is required fir textbox2 to not to need a "refresh" click. In fact, in the final version the refresh will be absent.
To address your comment about the auto-refresh no longer being on the editor, please see this post: https://github.com/ManageIQ/manageiq.org/pull/663/files. This is the targeted refresh change you're talking about. It still has the same functionality, we just made a bunch of improvements to the system. The load_values_on_init not being on the editor is covered a little here: https://github.com/ManageIQ/ui-components/pull/296. Only the dialog fields that inherit from SortedItem will show load_values as an option in the editor. Dropdowns and checkboxes are sorted. Text boxes are not. This is how it's always been. "It is required fir textbox2 to not to need a "refresh" click." Then please open an RFE about that because this works as intended, like I said previously in comment 23. I'm not sure what you mean by "In fact, in the final version the refresh will be absent."
This might be partially related to the issue described here: https://bugzilla.redhat.com/show_bug.cgi?id=1586157 but it's pretty hard to tell from the description of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=1583704 might also be related too, but from the description of this bug I can't tell that either. Reartes, can you please check to see what happens when you submit the dialog without changing the fields at all and tell me if the values that get passed through the API call are the ones that were displayed when you submitted the dialog please?
I feel like the described issue, as far as text boxes are concerned, is a dup of https://bugzilla.redhat.com/show_bug.cgi?id=1380504.
I'd really like a reproducer for this so I can see exactly what's going on.
Shveta, can you work with Drew and Comment 33 please, thanks!
Hi Drew , Please check these two appliances . https://10.8.199.197/ - upstream master https://10.8.198.6 - 5.8 appliance . The issue is in 5.8 if the text box is dynamic and "show refresh button" is checked , "load values on init " checkbox also shows up as an option in the dialog settings. where as in 5.9 if the textbox is dynamic ,show refresh button = Yes , "load values on init" does not display . So it's a UI bug, I think we have missed to add that button for dynamic text box when "show refresh button " is checked.
Dan, I assigned this to you per Shveta's comment 35 because she's right, the load values thing shows up in 5.8 editor for text boxes.
Discussed the issue with Erik: He said the checkbox needs to be there and that it's also missing for text area box, check box field, and radio buttons.
Fixed in PRs: https://github.com/ManageIQ/ui-components/pull/296 https://github.com/ManageIQ/ui-components/pull/303
New commit detected on ManageIQ/ui-components/master: https://github.com/ManageIQ/ui-components/commit/fbf2ac4f7b8e5955bca40a9fbcce0834c002e2b1 commit fbf2ac4f7b8e5955bca40a9fbcce0834c002e2b1 Author: Roman Blanco <rblanco> AuthorDate: Tue Jun 12 11:14:37 2018 -0400 Commit: Roman Blanco <rblanco> CommitDate: Tue Jun 12 11:14:37 2018 -0400 Added missing checkbox to allow load dynamic dialog values on init Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1576107 src/dialog-editor/components/modal-field-template/check-box.html | 7 + src/dialog-editor/components/modal-field-template/text-area-box.html | 7 + src/dialog-editor/components/modal-field-template/text-box.html | 7 + 3 files changed, 21 insertions(+)
https://github.com/ManageIQ/manageiq/pull/17631
"Load values on init " is shown for dynamic text boxes in 5.10.0.3.20180705151325_ce4d2b5