Skip navigation
JStellato
Currently Being Moderated

Can't Override Calculated Fields

Apr 10, 2009 8:00 PM

Hello,

 

I have a form that has fields in which are calculated, they are set though to calculated allow override.  When we type in a value that's not calculated, it pops up the warning message, allows you to change the value, but the second you click off of it, it reverts back to the original value.

 

Any ideas on how to fix this?

 
Replies
  • Currently Being Moderated
    Apr 10, 2009 11:32 PM   in reply to JStellato

    What type of object is it?

     

    How are you calculating the object value?

     

    Do you initialize the object value in the initialize event?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2009 9:21 AM   in reply to JStellato

    Joe,

     

    You have come across some behaviour for the 'Calculated - User Can Override' Value property that you (and almost everyother user) would question. While I cannot explain it, I will share my observations.

     

    For a TextField with a Value proprerty of 'Calculated - User Can Override', Designer expects a script to be attached to the Calculate event. While you have attached script to the Calculate event, it appears that Designer is VERY picky about what the script does. It appears that a variable assignment is expected regardless of the target variable.

     

    If I add 'var foo = "bar";' to the Calculate event of TextField, Designer behaves as you would expect.

     

    If I add 'xfa.host.messageBox("foo"bar");' to the Calculate event of TextField, Designer does NOT behave as you would expect. The TextField rawValue is set to '1'.

     

    Additionaly, if you do not have any script in the Calculate event, Designer will reset the Value to 'User Entered - Optional'.

     

    My solution is attached. I added a comment ("//') to the Calculate event to preserve 'Calculated - User Can Override' and then drove the population of the TextField from the CheckBox.

     

    Steve

    Attachments:
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points