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
Related
I try to create custom content part with following specification.
I need to add list of items in database with same editor template view page of driver.
I want to include one form with required fields with an add button, by using this add button I want to add more number of rows with given field values in database.
I have checked Orchard documentation in this link, they provide sample with single item add in editor template page. In my case I need to add multiple items in editor page.
In display view page of driver, I want to retrieve collection of data from database and rendered in display view page.
Please share some details for this.
Thanks,
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.
I have an Xpages application that pulls data from another .nsf file. I have a view panel linked to a view in that db. The view has documents with several different forms in it. I want to be able to open each document in it's own form(xpage).
How do I write a computed At Runtime, open selected document using: statement that will select the correct Xpage to present the document.
If you use the Data View component instead of a View Panel, you can compute the pageName attribute, referencing the var attribute to return a different value for each row based on the document that row represents. The flexibility of the Data View component also makes it easier to make your app look more like a modern web application and less like an Excel spreadsheet. As an additional bonus, the mobile theme invokes a renderer that makes each Data View instance look like a native mobile list, so using Data Views instead of View Panels simplifies mobile development.
You have 2 options:
use "use xpage associated with form" and edit the form's property
use a SSJS formula to compute the Form. You provide a variable name in the view control var to access a view row as XSPViewEntry. If the Form is in a view column even one you don't display you use .getColumnValue otherwise getDocument.getItemValueString
Does that work for you?
Maybe this mothed can help you: Unable to get document page name for
Hope this helps
Mark
I had a similar problem today. I use only one form but 3 different xpages for associated with this form. I have 3 different document types in the view. I used rowData the get the type of the document.
try{
var v=rowData.getColumnValue("form");
if(v.indexOf("x")> -1){var page ="x.xsp"}
else if(v.indexOf("y") > -1){var page = "y.xsp"}
else{var page = "z.xsp"}
}catch(e){
var page = "x.xsp"
}
So to your view you can create a column with the value of the form and you can use it.
I have used the extension library Dynamic View control which has an event you can code to get a handle to the NotesViewEntry which was selected. See the demo database page Domino_DynamicView.xsp and the Custom Event Handler tab for an example.
Note, in 8.5.3 (I have not upgraded yet) if you add or edit the eventHandler for onColumnClick it will be added to the XPages source as an xe:eventHandler. It needs to be an xp:eventHandler to work. The way to do it is to copy the code in the source from the exiting event and delete it. Recreate the event and update the code. Then go back into the source and change the tags within the eventHandler to xp:.
My CRM is configured in outlook , and i need to add File attachment in campaign form , I tried Customize->Form... But i cant find File attachment in Field Explorer..
So how to add this, as shown in image...
thanks.
In CRM Dynamics 2011 there is no control for file explorer. You have to add a control like that through a Webresource (HTML5 or Silverlight) or Iframe that points for an aspx page.
Your screen shot looks like a custom development that isnt a standard control. That said you will probably achieve what you want by just adding the notes grid to your form. A note can have attachments and has a standard file explorer.
Go back into customising the form, click the insert tab on the ribbon, click notes.
It’s not that hard to knock something up in Silverlight. The annotation entity is just a normal entity and can be written to just like any other. Here is a screen shot of it integrated into a normal CRM form. The control allows you to drag and drop files or click the upload button to be presented with a file dialog box
Oh and one last helper point, the document is stored in the attribute “DocumentBody” as a base64 encoded string. You can then read that and convert it into a byte array to save to disk etc
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