Is it possible to keep images in configuration document in lotus notes? - lotus-notes

I am trying to keep image in configuration document, in order to change the image dynamically i am not able to do like that.or Is there any other way to keep images in forms or pages without entering into code everytime?

If I understand correctly, you want to dynamically change/replace the Image in the form/Page design element without using the notes designer.
In Notes, all Design elements are treated as a document and each design element have a unique UNID. The "$Body" field stores the content of the form or page
You could do this by taking the UNID of the page or form and use db.GetDocumentByUNID() method to get handle to the Page or Form design element. Then modify the content of "$Body" field in lotus script to update image or any other data (table/text) in the Form/page. The changes will reflect in the Form/Page.
The UNID of the Page/form can be found in notes designer.
Let me know if this helps.

Related

Why is the wrong form opening when I click the doc link I created from a SSJS function?

Ok, this is weird. I created an xpage input form. After the form is filled out, a document is created. I then create an email to notify people that the document has been created. I drop a doclink to the newly created document in the body of the email. During testing, I noticed that when I click the link in the email, the wrong Notes Form is opened. Instead of the 'TrainingRequest' form displaying the fields, the form 'Feedback' opens up instead. Here's what I checked:
- On the xpage data section, the 'form' is set to 'TrainingRequest'.
- When I open the document via the doc link, the field 'form' has the value 'TrainingRequest', which is correct. Yet it's displaying the 'Feedback' form.
- When I check the other field properties of the document, all the correct fields from the 'TrainingRequest' form are there and populated correctly.
- When I open the document via the view, the correct Notes form 'TrainingRequest' opens.
- There is no default form in the database design.
Has anyone seen this before?
thanks
clem
Doc links are always created using the default view of your application. If there is a form formula in this view then this overrides the form in the document. Remove the form formula of the default view and it works.
I almost NEVER use form formulas in my application because of the side effects.
Source code would be useful. But initial best guess based on what you're saying is you have two datasources on the XPage, neither have ignoreRequestParams set, so you're editing the same document with both data sources. ignoreRequestParams missing will ignore any properties you define.

How to open a document in a dynamiccontent control facet from a viewpanel control

I have a dynamiccontent control on a XPage with a facet containing a custom control which has a viewpanel in it. I also have a second facet in the dynamiccontent control containing a custom control which is connected to a document data source.
What I am trying to figure out is when the viewpanel custom control is loaded in the dynamiccontent how do I get the links in the viewpanel custom control to load the dynamiccontent facet containing the custom control connected to the document data source and display the document?
I think the Dynamic Content example in the Extension Library Demo database is self explaining. It use also a view and a document
Well I'ver always found ViewPanels to be very limiting if you want to do anything fancy. I don't think you can easily use any of the built in features. I would personally use a Repeat Control and then have a button that takes the intended document and gets the unid. You can then put that unid into a viewScope variable, change your dynamic content control to the document facet and have that custom control get the unid from viewScope to get the correct document.
I long time ago I did a rather crappy demo that showed a couple of these techniques. https://www.youtube.com/watch?v=GSLAy6U2_3A
The CSS attempt failed there but you should be able to see a repeat control and putting the unid into scope etc. It might help you a little.

Attachment download from view

Is there a way to list all documents in a view control (or a repeat control) and have a download button / link that will allow the user to download multiple attachments that reside in a rich text field?
I have found options using the #AttachmentName, however this lists all attachments on the document and does not restrict the attachments to just one the RTF.
I have a work around using a dialog box, which does work well, just not as clean as the option I was looking for.
In a view you can have a computed column. Any code you place into a dialog could be placed into a computed column. The getDocument() method of the XSPviewEntry gives you access to the document (recycle wisely).
update
To use a download control, use a repeat with the view as datasource and a panel per row. The panel has the data source pointing to a document. Use tr as tag for the panel.
This is only needed if you have attachments in other fields you don't want to show

Converting richtext to MIME / HTML?

I have a old Notes Database that was designed with tradtional Notes forms for both the client and the web.
I still want to keep the old database in the traditonal Notes client. But display the rich text as HTML in xpages.
I selected the Store contents as HTML and MIME on the rich text field on the form but when I do, it destroys all of the formatting and removes things like collapsable sections. But it does allow the content to be displayed even though it is not pretty.
I found this thread:
XPages RichText Links
Where Steve recommends using that option.
He goes on with a further solution that I am not sure I understand it at all.
We have lots and lots of content, so asking the users to redo it all manaully is not an option. Is there anyway we can either just display this rich text content or at least convert it while keeping all of the formatting and collapsible sections?
When you check that option you destroy the existing content formatting if you don't convert the content. The conversion is not perfect and is what the RichText control does on the fly.
The set of actions you want to take:
get the coexedit plugin or the
add a new RT field with the MIME
run an agent to
optional: remove the old field and rename the new to the old name (make sure mime stays checked)
For read only access (both options get better with the coexedit plugin) :
use the RichText control, no further action is required
use a Dojo panel. It has a href property you point to ... Body?OpenField, no further action is required
Note:the later doesn't work in XPiNC

Xpages File Upload Control does nothing

Background: One xpage bound to document1. On this xpages is a tabbed table contain several tabs. Each tab contains an panel bound to other data sources incl document2. Document2 is created and made a child of document1. In each panel is a table to allow the user to create the new document, as well as two view controls. Everything works beautifully...until...
Problem: I was asked to add a way to upload an attachment to the child document. I first created an rich text field on the bound document called "ScannedInvoice". I then create a File Upload Control from the core controls and bound it to document2/ScannedInvoice. By rule, I only want a single attachment, otherwise I would consider the openNTF upload control.
I cannot figure out why nothing appears on the back end when I upload a file and create a new document. Everything else works, but there is no attachment in the ScannedInvoice field and also no $FILE fields attached to the document either.
Thanks in advance for any tips. I have searched quite a bit and have not found any answers. - Steve
<xp:fileUpload id="fileUpload1"
value="#{document2.ScannedInvoice}" useUploadname="false"
style="font-size:8pt" filename="scannedinvoice.jpg"
mimetype="image/jpeg">
</xp:fileUpload>
Note: The field ScannedInvoice on the Invoice form is rich text.
Code to save button: document2.save()
Document2 has scope=request and ignoreRequestParam=true. Both of these have to be set like this in order to work. parentID=# document1.getNoteID()
a file upload needs a full refresh of the page to be able to upload the file. Make sure that you are doing that.
======================================
Update Domino 9.0.1 supports partial refresh uploads

Resources