Hello,
Is it possible de assign a null value to a custom property of a form ?
Hello,
Is it possible de assign a null value to a custom property of a form ?
Well, you can pass None to a custom property ( instead of NULL, but they are the same).
From “Stack Overflow”:
In Python, the ‘null’ object is the singleton None
.
The best way to check things for “Noneness” is to use the identity operator, is
:
if foo is None:
...
Hi,
Your answer is How to test. But my question is How to attribute a null value to a custom properties. We try null, Null, none, None and we Always have an error.
Use NULL as an expression.
Well, I tried to pass None
to a String Custom Property ( via scripting ) and after that assignment, the custom property had a None
value ( which is the same of NULL )
Here it is the code I used:
event.source.parent.getComponent('PB Device').Null = None
print event.source.parent.getComponent('PB Device').Null
print type(event.source.parent.getComponent('PB Device').Null)
And that’s the output:
None
<type 'NoneType'>
Perhaps, post your code so we can try to understand your final goal
This may be the crux of your problem. Custom properties can hold a null (jython None
), but input fields generally cannot hold nulls in their text
or numeric value
properties.