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



Jun 29, 2013, 10:01 PM
453 Posts
topic has been resolvedResolved

Getting a CheckBox to return a boolean value.

  • Category: Other
  • Platform: All
  • Release: 9.0
  • Role: Developer
  • Tags: CheckBox
  • Replies: 3

I have a field in a Notes form called UseSSL which is defined as a number, with Zero Decimal places. I have a checkBox on my XPage bound to UseSSL and I have it set as boolean.

I have got the XPage stripped down to a bare minimum. On the check box I have left the Checked and Unchecked values as the default which should be true for checked and false for UnChecked as I understand the documentation.

If I open my test Xpage in the browser and select  the UseSSL check box then submit the document I get an Alert that the value is not Boolean, If I leave it blank and submit it I get a message:

Error saving data source document1
Could not save the document NEW_8 NotesException: Unknown or unsupported object type in Vector

I can't make the process any simpler but have now spent way to much time trying to get a single check box to work.

 

Jun 30, 2013, 11:40 AM
54 Posts
true or false

I didn´t know exactly what you have done.

Field is type number without decimal places in my form.

The checkbox in my xpage has value if checked = @True();  value if not = @False();

If I save this xpage it will return "1" or "0" as string; but without any error.

Jun 30, 2013, 5:04 PM
366 Posts
It doesn't work the way you think/the documentation says it works

When I saw this I too thought this was for storing Boolean values, but the problem is there is NO underlying document field type that supports storing a Boolean Value.

 

so this is a converter but then you still have to convert the value back to a integer for storing it.  No really very many use cases for this AT ALL in my opinion.

 

 

Jul 1, 2013, 3:56 PM
453 Posts
CheckBox returning a boolean value

I mis-read the default of the check box when it says the Default Checked return is true it does not mean 1 but the literal string "true" So after a lot wasted time figured out that needed to add a convert .

getAsString value == 1 ? "true" : "false"

getAsObject value == "true" ? 1 : 0

So the saved value is boolean  1 or 0

The solution is pretty simple but not at all obvious. The documentation gives very little help


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