Page 1 of 1

Problem using Checkbox and POSTing to ParseDB using Boolean Type

Posted: Thu Oct 11, 2012 1:28 am
by egonzalez

Having trouble mapping checkbox to Boolean type in ParseDB. The component has a default value of true but the service throws the following error when invoked:

"error": "invalid type for key ptaNotes, expected boolean, but got string"

So I added javascript to the mapping.

return Boolean();

This allows service to be invoked successfully but always passes in 'true'.

So I changed the javascript to.

return Boolean(value);

This allows service to be invoked successfully but always passes in 'false'.

Neither of these solutions are passing in the actual value. What am I missing? I am obviously new to this.
Thanks!


Problem using Checkbox and POSTing to ParseDB using Boolean Type

Posted: Thu Oct 11, 2012 3:00 am
by maxkatz

Do:

code
console.log(value);
/code
to see what you actually get.


Problem using Checkbox and POSTing to ParseDB using Boolean Type

Posted: Tue Oct 16, 2012 3:07 pm
by egonzalez

That was the first time I used console.log(value) and I didn't realize how helpful that is. I feel like I'm learning javascript in reverse but it's still fun to see things come together so fast. Thanks again!