Anyone have a good example.explanation of load() versus with(). It's troubl

Anyone have a good example.explanation of load() versus with(). It's troubling me that I'm having challenges with this concept.

OriginalPostID-159281

OriginalPostID-159281

  Discussion posts and replies are publicly visible

Parents
  • Hey Richard, check if this is useful. Load works the first time when the component/form is loaded.
    eg: =load(local!var2:1,load(local!var1:ri!input1,local!var3:var1+var2,
    a!formLayout(label:"",firstColumnContents:a!textField(label:"Test it",
    value:var3, saveInto:var1))))
    In example the local!var3 is initialized once in inner load, and will only change if explicitly changed in the saveInto (which is not done). Thus the value never changes for new inputs. Now change replace inner load with 'with'. Then run it. You will see the value of local!var3 is computed every time you enter an input, That is with refreshes its initialization and runs functions/rules, every time a change occurs in any of its local values.
Reply
  • Hey Richard, check if this is useful. Load works the first time when the component/form is loaded.
    eg: =load(local!var2:1,load(local!var1:ri!input1,local!var3:var1+var2,
    a!formLayout(label:"",firstColumnContents:a!textField(label:"Test it",
    value:var3, saveInto:var1))))
    In example the local!var3 is initialized once in inner load, and will only change if explicitly changed in the saveInto (which is not done). Thus the value never changes for new inputs. Now change replace inner load with 'with'. Then run it. You will see the value of local!var3 is computed every time you enter an input, That is with refreshes its initialization and runs functions/rules, every time a change occurs in any of its local values.
Children
No Data