How do you pass a NotesDocument / NotesViewEntry Collection into a Custom Control via custom property?

不问归期 提交于 2019-12-07 15:18:30

问题


I want to have a custom control that works on whatever documents I decide to pass to it. What's the best way of doing that?

Assuming that you can't pass the collection directly... should a function be created to convert the collection to a hashMap or vector of UNID's?

Is there another way?

Thanks


回答1:


Passing NotesDocument and/or NotesDocumentCollection objects to the Custom Control works fine. Just set the Custom Control's property type as java.lang.Object. By this you can transfer what ever objects to the Custom Control.




回答2:


If you instead pass a data source, you'll get recycle-safe objects transferred to the Custom Control.

For example, if the XPage defines a document data source, and you pass a reference to that data source to the CC, the Java object being transferred is a DominoDocument, which is a recycle-safe wrapper around the "back end" document. Passing the document directly risks that the linked C object will get orphaned between requests.

Similarly, passing a reference to a view data source provides the CC a DominoView, which is essentially a recycle-safe wrapper around a back end ViewEntryCollection.

For most use cases, you can get away with just passing the back end object directly, but passing the data source is far safer.



来源:https://stackoverflow.com/questions/9821518/how-do-you-pass-a-notesdocument-notesviewentry-collection-into-a-custom-contro

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!