Hide line from script content when widget unselected #14
Unanswered
monicagiraldochica
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Dear @monicagiraldochica, When you want to remove a line in the script section, use "disable-" instead of "hide-". Thanks, |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Perhaps, I figure out what you're trying to do. The Note that the first widget options also work as follows. Thanks, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thank you again for this amazing app. I continue to personalize for our users and would appreciate some help with the following:
I have 3 partitions: normal, bigmem, gpu. A widget called nodes should only be visible when the selected partition is normal. That works! And then when the user types in the number of nodes, it gracefully adds the line #SBATCH --nodes=n. However, when the user unselects the checkbox widget, that line stays in the script content. And I would like to remove it. How do I add an action for when a checkbox is unselected? In this case I would guess it would be, assign empty value to widget nodes? Also, if after writing the number of nodes I go and chose any of the other partitions, my widget disappears but the line in the script is still there. Our users love to request multiple nodes when they dont need to :-) so I would like to reduce that temptation as much as possible :-).
By the way, the same happens with things like "show email options". I would love to remove the email lines if possible, when the checkbox is unselected.
This is my current code:
partition:
widget: select
label: Partition
required: true
options:
- [ Normal,
normal ]
- [ High memory,
bigmem,
set-label-cores_memory_2: "Memory per core (up to 31GB)",
set-value-cores_memory_2: 31,
set-max-cores_memory_2: 31,
hide-show_nodes_option,
hide-nodes ]
- [ GPU,
gpu,
hide-show_nodes_option,
hide-nodes ]
show_nodes_option:
widget: checkbox
options:
- [ "My job uses MPI", "", show-nodes ]
nodes:
widget: number
label: "Number of nodes (1 - 30)"
indent: 1
min: 1
script: |
#!/bin/bash
#SBATCH --account=#{account}
#SBATCH --partition=#{partition}
#SBATCH --nodes=#{nodes}
#SBATCH --cpus-per-task=#{cores_memory_1}
#SBATCH --mem-per-cpu=#{cores_memory_2}G
#SBATCH --time=#{zeropadding(time,2)}:00:00
#SBATCH --mail-user=#{email}
#SBATCH --mail-type=#{mail_option}
Thanks!!
Beta Was this translation helpful? Give feedback.
All reactions