Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
jasonstorey

Member
Registered:
Posts: 19
Reply with quote  #1 
I have tried

setField('my_field','',true) and it works fine,

and vice versa with false.

My problem is this is supposed to toggle.
and unfortunately:

setField('my_field','',!getField('my_field'))

didn't work.

Any thoughts?

FYI: (this is done in an onclick <a href='#'> tag on a label)

__________________
JasonStorey
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
You can't use '!' because it will not evaluate to a Boolean value, although it appears (from your tests) that it will accept a Boolean value to set it. You should use something like

setField('my_field','', getField('my_field') == 'true')

I am not sure what the getfield returns, you may need to check that.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
jasonstorey

Member
Registered:
Posts: 19
Reply with quote  #3 
thanks, you got me thinking in the right direction. 

I managed to get it working with this horrible bit of code.

 
setField('ck_Valid','',(getField('ck_Valid') == 'true') ? 'false' : 'true');

plus I was wrong on the boolean being able to set it,
there was another value setting it elsewhere contaminating my tests.

in short:


check evaluates to either 'true' or 'false' and can only be set as such. (also myBoolean.toString() is no good either)


Thanks again Jerome,
Helpful as always.
 



__________________
JasonStorey
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!