...
When I first threw the checkbox code into my test app I put together a couple of routines in place of some embed code. I didn't have a really good reason for doing that (too many legacy apps on my brain lately?), and when Mike Hanson looked at the code he quickly pointed out that the code should be in local class methods.
Here's the procedure-level class that wraps up all of the functionality:
Code Block |
---|
CheckboxList class ListCheckbox &CML_UI_ListCheckbox Persister &CML_Data_ManyToManyLinksPersisterForABC Links &CML_Data_ManyToManyLinks Construct procedure Destruct procedure DisplayCheckboxData procedure Init procedure LoadEnrollmentData procedure SaveEnrollmentData procedure end |
...
To be safe, call either MyBrowse.UpdateBuffer (which fetches the highlighted record from the queue and updated the corresponding fields in the record), or MyBrowse.UpdateViewRecord (which additionally fetches the record from the database). Avoid low level code like GET(Queue:Browse:1,CHOICE(?Browse:1)).
AlternativelyAlso, I often want the user's "click" to fire some code, even if the record hasn't changed. That's why I'll often use the TakeAccepted handler for the control event, rather than (or in addition to) the browse class' TakeNewSelection method.
...