Dear All
I have a problem with a "slave" Drop-Down (field-scan_run_id) whose option values are set dynamically according to value chosen in another "master" Drop-Down (field_db_name).
The "slave" drop down auto-clears after I choose a value on it - practically I cannot set anything on it!
The code is below:
<form>
<label>Scan Compare 002</label>
<fieldset submitButton="false" autoRun="false">
<input type="time" token="field1">
<label>Time</label>
<default>
<earliest>-30d@d</earliest>
<latest>now</latest>
</default>
</input>
<input type="dropdown" token="field_db_name" searchWhenChanged="true">
<label>Database</label>
<fieldForLabel>DB_NAME</fieldForLabel>
<fieldForValue>DB_NAME</fieldForValue>
<search>
<query>index=omega_ds | DEDUP DB_NAME | FIELDS DB_NAME</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
</search>
<change>
<unset token="form.field_scan_run_id"></unset>
</change>
<selectFirstChoice>true</selectFirstChoice>
<prefix>"</prefix>
<suffix>"</suffix>
</input>
<input type="dropdown" token="field_scan_run_id" searchWhenChanged="true">
<label>Scan Id Run</label>
<search>
<query>index=omega_ds
DB_NAME=$field_db_name$
| stats
earliest(_time) as SCAN_DT_START
by DB_NAME SCAN_ID
| sort - SCAN_DT_START</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
</search>
<fieldForLabel>SCAN_ID</fieldForLabel>
<fieldForValue>SCAN_ID</fieldForValue>
<prefix>"</prefix>
<suffix>"</suffix>
</input>
</fieldset>
</form>
I noticed that if I remove the
<change>
<unset token="form.field_scan_run_id"></unset>
</change>
at "master" input field_db_name - the problem goes.
But I need to clear the existing value of the "slave" value since it will keep the old value which will be sure NOT be present in the new range of options changed by the chosen value in "master".
can someone please advise?
best regards
Altin