Wednesday 15 May 2013

xpages - get the attachmentnames out of a form with 2 RTF fields -



xpages - get the attachmentnames out of a form with 2 RTF fields -

i have form 2 rich text fields.(for exmaple rtf1 , rtf2)

in each field user upload 1 attachment.

for each field store attachment name field(for exmaple name1 , name2).

when utilize @subset(@attachmentnames;1) in form name1 name of attachment of rtf1. when utilize same name2 name of rtf1 1 time again not want.

eventually if there's way ssjs instead of dooing in form, also.

it seems cannot utilize simple formula here. instead can access corresponding rtf via ssjs, embeddedobjects (even if there 1 attached) , name of store in text field. should work:

value of text field, assuming datasource named document1:

try { var rtf:notesrichtextitem = document1.getdocument().getfirstitem("rtf1"); var eos:java.util.vector = rtf.getembeddedobjects(); for(x=0; x<eos.size(); x++){ var eo:notesembeddedobject = eos.elementat(x); homecoming eo.getname(); } } catch(e) {}

not tested, ymmv

xpages lotus-notes xpages-ssjs

No comments:

Post a Comment