Change the value of a check box programmatically?

Everything related to the development of modules in jamovi
Post Reply
rjwatt42
Posts: 10
Joined: Sun Oct 08, 2023 10:22 am

Change the value of a check box programmatically?

Post by rjwatt42 »

Hi,

I am working on a module that does a procedure with a random process in it. In order to see how much the particular output depends on the specific instance of that random stage, it would be nice to be able to repeat the procedure. Conceptually, the simple way to do this would be to have a push button "Repeat" or something similar.

Maybe there is some sort of workaround that would be within reach. For example, I can use a check box called "Toggle this for repeats" and disregard its state - so the procedure executes whether it is TRUE or FALSE.

What would be really nice was if there was a way to set the check box to FALSE once the procedure had been done. Is there any way of achieving this?

Many thanks,
Roger
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Change the value of a check box programmatically?

Post by MAgojam »

rjwatt42 wrote: Tue Feb 27, 2024 10:40 am Conceptually, the simple way to do this would be to have a push button "Repeat" or something similar.
Hey Roger,
I don't know if this is what you're looking for, but are you aware of the Action type?
You can see a use in the module jReshape [aut Marcello Gallucci] or jTransform [aut Sebastian Jentschke]

You should include this in your a.yaml file

Code: Select all

  - name: btnRep
    type: Action
    title: Repeat
    default: false
So you will have a self$options$btnRep available, to intercept in the run process.
If you want, you can always try other solutions, using some fragments of javascript code.

Cheers,
Maurizio
rjwatt42
Posts: 10
Joined: Sun Oct 08, 2023 10:22 am

Re: Change the value of a check box programmatically?

Post by rjwatt42 »

Many thanks, Maurizio - that is perfect.
Post Reply