Issues with dynamic form widgets

OnDemand version: v2.0.27 I would like to hide singularity_img field if the user chooses “Custom Conda Environment…”. If the user chooses “Custom Singularity Image…”, then custom_conda field should be hidden.

However, when I choose either “Custom Conda Environment…” or “Custom Singularity Image…”, singularity_img field is hiddent and custom_conda is available. Am I missing something?

form.yml

  version:
    widget: select
    label: "Python version"
    help: "This defines the version of python you want to load."
    options:
      - [ "pytorch_gpu/1.11.0","pytorch_gpu/1.11.0",
          data-hide-singularity-img: true,
          data-hide-custom-conda: true
        ]
      - [ "pytorch/1.8.1 cuda/11.1.1","cuda/11.1.1 pytorch/1.8.1",
          data-hide-singularity-img: true,
          data-hide-custom-conda: true
        ]
      - [ "tensorflow/2.4.1 cuda/10.1","cuda/10.1 tensorflow/2.4.1",
           data-hide-singularity-img: true,
           data-hide-custom-conda: true
        ]
      - [ "Custom Conda Environment...","na",
          data-hide-singularity-img: true
        ]
      - [ "Custom Singularity Image...","na",
          data-hide-custom-conda: true
        ]

  singularity_img:
    widget: "text_field"
    label: "Path to singularity image"
    help: "Enter the **full** path to your singularity image. (i.e. `/ihome/crc/install/ondemand/jupyter_deep_learning/pytorch-22.04-py3.sif`)

NOTE: If not using a singularity image, you must have jupyterlab installed in your singularity image."

  custom_conda:
    widget: "text_field"
    label: "Path to custom conda environment"
    help: "Enter the **full** path to your custom conda environment. (i.e. `/path/to/your/conda/env`)

NOTE: If not using a custom conda environment, you must have jupyterlab installed in your custom conda environment."

Hey sorry for the trouble.

Looking at this I’m not quite sure what is happening, but I would be curious what happens when you change the na on the "Custom Singularity Image...", "na" to something different from the line above it.

1 Like

Yes. This change resolves the issue.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.