This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 27, 2012, 5:57 PM
5 Posts

Visible formula not work with Checkbox Control

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: Visible
  • Replies: 3
Hi,
 
   I want to hide a field unless the user clicks in a Checkbox that is above the field. I am using the Checkbox Group control from the Core Controls.
 
   The hidden field is never revealed when triggering off the value in the Checkbox. But it does appear if I use a value from an Editbox.
 
   Does anyone have any insight to why this works with an Editbox but not the Checkbox control?
 
   Here is the Visible formula in the field below the Checkbox. The only option for the Checkbox is "No".
 
  if (getComponent("checkBoxGroup2").getValue() == "No")
{
return true;
} else  {
return false;
}
 
Thanks very much,
 Tim

Sep 27, 2012, 8:44 PM
50 Posts
Re: Visible formula not work with Checkbox Control
 try getComponent("checkBoxGroup2").getSubmittedValue() == "No" . You don't need the if... statement.
 
Oct 3, 2012, 6:53 PM
5 Posts
Re: Visible formula not work with Checkbox Control
Thanks for the suggestion.
 
Unfortunately, it still did not work for a 'checkBoxGroup'. 
 
I do like the shorter syntax, though.  Any other ideals?
 
 
Tim
 
 
Oct 3, 2012, 8:16 PM
38 Posts
Re: Visible formula not work with Checkbox Control
On XSnippets I have posted a snippet, to get the ComponentValue
http://openntf.org/XSnippets.nsf/snippet.xsp?id=getcomponentvalue 
 
Put the function a SSJS Scriptlib and call it. You will get the component value in return, no matter what. 
 
Or 
 
Try to compareTo method of the String object, like return getComponentValue("componentID").compareTo("No") 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal