Hello Steve,
On 05/16/2017 05:21 PM, Steve Huston wrote:
I've extended the UI for host addition by including a
multivalued
widget which stores puppetVar values (as well as the accompanying
Python plugin to handle it and schema update in the directory). This
works well, but I'd like to add one more thing and am not sure how to
do it.
There are certain variables which are basically always set for every
host, and so I'd like them to default to those values in the UI, while
still giving the admin the choice to edit or remove them just like
they were entered by hand. I'm not sure, however, how to "push"
values into the UI that way.
Could you please write an example of the variable?
Is there some attribute of a field I can edit to insert a default
value into the UI, while still allowing that to be removed or edited
before the user submits the page?
In case you want to prefill a dialog by default values you can do it by
using that.get_field('fieldname').set_value(['value1']); in open()
method of the dialog. But I'm not sure whether this is what you want. If
not please send an example of what you want to achieve.
HTH
--
Pavel^3 Vomacka