Page 1 of 1

table visibility

Posted: Mon Apr 24, 2017 5:26 pm
by mcfanda@gmail.com
Hi
I'd like a result table to appear only when some specific results are present. The example is as follows:

in mymodule.r.yaml I have this table definition

- name: cov
title: Random Parameters correlations
type: Table
visible: (showRandomCov)

the value of the variable "showRandomCov" can only be computed after the results are computed. Can I condition its visibility to some result value?

p.s. I've tried to compute showRandomCov in the mymodule.b.R but I get the error "Could not resolve "showRandomCov"

Re: table visibility

Posted: Mon Apr 24, 2017 6:28 pm
by Ravi
Hi,

You cannot make the visibility of a table dependent on your results using only the YAML. However, you can do this in the analysis file (.b.R). To do this you first have to set the visibility of your table object to false in the .r.yaml like this:

Code: Select all

    - name: cov
      title: Random Parameters correlations
      type: Table
      visible: false
This will hide your table by default. Next you can add a statement in your .b.R file to set visible to true if a certain condition is met. For example like this:

Code: Select all

if (condition == TRUE) {

    table <- self$results$cov
    table$setVisible(TRUE)

}
Now, it will hide your table unless the condition is met.

Re: table visibility

Posted: Tue Apr 25, 2017 10:06 am
by mcfanda@gmail.com
great, thanks