How to send a document data souce to a custom control in XPages?

和自甴很熟 提交于 2019-12-11 01:37:51

问题


I have this computed text bound to a the body field using EL

 <xp:text escape="true" id="computedField1" value="#{doc.Body}"></xp:text>

Now I need to store this computedField in a Custom Control and send in the doc? What property definition should I use, and how do I reference the compositeData to the Body field in the cc

thanks

Thomas


回答1:


Create a custom property on your Custom Control called dataSource and set the type to com.ibm.xsp.model.DataSource

Create a second custom property called computedFieldName and set it's type to string

In the computed field in the custom control set the value like

value="#{compositeData.dataSource[compositeData.computedFieldName]}"

When using the custom control just set the custom properties like:

computedFieldName="Body" dataSource="#{doc}"



来源:https://stackoverflow.com/questions/45982623/how-to-send-a-document-data-souce-to-a-custom-control-in-xpages

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