My RP sends the #PRIM_TREE to a server function to get entries added. In some cases, I want to change the style of a label at runtime.
Where do I do that? The server module just gets the fields, so it doesn't know about the labels. The Tree Item exposes a property for the label I want to change.
Is this the best way to update all the items? I'm doing this in the server module completed event.
selectList #tree
#CurrentTreeItem <= #tree.Currentitem.design *as #TreeItemRP
#currentTreeItem.pLabel2.style <= #Theme01<Text10BoldAlmostBlack>
endSelect
Thanks, Art
Tree Item formatting changes at runtime
Tree Item formatting changes at runtime
Art Tostaine
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Tree Item formatting changes at runtime
Hi Art
You can expose a property/method as you've already done and handle it in the component containing the Tree, or you can code it in the design instance. My personal preference is the latter, but it's really only personal taste and coding style.
The OnAdd method on the iTreeDesign interface will be executed when an entry is added, and similarly the OnUpdate method will execute when Upd_Entry is used. All field values will have been updated prior to the methods running, so you can test whatever values and code accordingly.
Regards
You can expose a property/method as you've already done and handle it in the component containing the Tree, or you can code it in the design instance. My personal preference is the latter, but it's really only personal taste and coding style.
The OnAdd method on the iTreeDesign interface will be executed when an entry is added, and similarly the OnUpdate method will execute when Upd_Entry is used. All field values will have been updated prior to the methods running, so you can test whatever values and code accordingly.
Regards