问题
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