Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Question for show/hide condition of variable #3122

youngkyu-kim ·
Hi. robin

I have a question for variable condition.
I want to change show/hide (enable/disable) condition for some variable on run configuration screen.
(not variables setting menu. I think, QB was checked to variable condition to enable at just 1 time when user pressed "Run the configuration" button.)
For example, there is two variables. var1 is check box, var2 is text input.
If I check to var1 in run configuration screen, I want to show var2. And, I uncheck to var1 - hide var2
Is is possible?
  • replies 3
  • views 1509
  • stars 0
robinshen ADMIN ·
This can be achieved by defining your variable as a custom bean. An example of custom bean can be found here:
http://wiki.pmease.com/display/QB60/Cha ... ld+Options
When writing your custom bean, the checkbox you mentioned will be referencing another child bean which in turn contains a text box.
youngkyu-kim ·
I already tried this.
I put below codes in condition of text input variable(VAR_INPUT), but it`s not work
(VAR_CHECK is variable which set "prompt as check box", VAR_INPUT is variable which set "prompt as text input")

// condition of VAR_INPUT
groovy:
if(vars.get("VAR_CHECK") != null) {
if(vars.get("VAR_CHECK").getValue() != null && vars.get("VAR_CHECK").getBooleanValue() == true) {
return true
} else {
return false
}
} else {
return true
}

Is it something wrong?
robinshen ADMIN ·
Sorry I gave the wrong link. The correct one here:
http://wiki.pmease.com/display/QB60/Com ... ld+Options

In your case the prompt bean can be defined as:

class BeanInput {
private String textInput;

@Editable
public String getTextInput() {
return textInput;
}

public void setTextInput() {
this.textInput = textInput;
}
}

@Editable
class PromptBean {
private BeanInput input;

@Editable
public BeanInput getInput() {
return input;
}

public void setInput(BeanInput input) {
this.input = input;
}
}