I wrote a function, which lists directories, which may contain “model” files in the following format
{dirpath1->dirname1, dirpath2->dirname2, ...
i.e. in format, suitable for PopupMenu
function.
Then I wrote a function, which lists model files in given directory in the same way
{filepath1->filename1, filepath2->filename2, …
I was wishing to select directory in first popup and then select file in second popup and wrote
PopupMenu[Dynamic[dir], GetModelDirectories[]]
Dynamic[PopupMenu[Dynamic[fil], GetMatFiles[dir]]]
It worked, but partially: if I change first popup, second popup turns empty
and I need explicitly select second popup
Is it possible to initialize second popup automatically to the first item in the list?