Add attachments to a xpage -
i have xpage data source attached notes document. on xpage have button calls method in managed bean. method retrieves notes document notes database. notes document has attachements in richtext field. these attachements shall copied xpage.
there way achieve this?
know how retrieve attachments notes document. how can attach them xpage?
for task can't use file upload control, because "file upload" should happend automaticly within mananged bean.
found call attachmentholdervalue may fulfil task, unfortunately there no documentation class.
ok donwload display use code this:
<xp:this.data> <xp:dominodocument var="yournewdocument"></xp:dominodocument> </xp:this.data> <xp:panel> <xp:this.data> <xp:dominodocument ignorerequestparam="true" var="download" action="opendocument" databasename="otherdatabase" documentid="calculated"> </xp:dominodocument> </xp:this.data> <xp:filedownload rows="30" id="filedownload1" displaylastmodified="false" value="#{download.richtextitem}"> </xp:filedownload> </xp:panel>
this add document other database dominodocument datasource wich can use bind <xp:filedownload>
to.
then add select attachments want copy new document recoment repeatcontrol , use like:
<xp:repeat id="repeat1" rows="30" value="#{javascript:download.getattachmentlist('richtextitem');}" var="attachment"> <xp:panel> <xp:label value="#{javascript:attachment.getname() }" id="label1"></xp:label> <xp:br></xp:br></xp:panel></xp:repeat>
insted of label add checkbox , in onsave event can run code wich copys selected elements new document (have in app).
you can copy them using notesdocument.copyallitems()
or saving attachments server disk , add them ritem.embedobject
new's documents richtextitem. recomend doing attachment copy in backend in expirience working attachments can tricky part.
Comments
Post a Comment