← servoy magazine

[Movies] Set font and replace

  • Movies

Building on a recent tip, Dean Westover brings us a demo movie illustrating how to format field objects globally. He also includes an interesting "replace" fuctionality.

View the movie here.

Once again, thank you Dean!

Comments (2)

Cain
Thanks for the tutorial! A couple of comments: 1) Is it necessary to set the field name into a global using onFocusGained on every field? Could you just capture the field name at the outset of the 'Set Field' or 'Replace' methods? 2) Is it really necessary that the element name matches the dataprovider name? Could you instead use something like forms[currentcontroller.getName()].elements[elementName].getDataProviderID() to get the name of the dataprovider based on the (possibly non-matching) element name?
Cain
AH! I see now. My mistake. As regards item 1 in my previous comment, I was thinking that the field itself was the trigger element, which is of course not the case.