This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 6, 2011, 8:46 PM
31 Posts

Cannot bind File upload control to Rich Text field...

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags:
  • Replies: 4
Hi all !
 
I thought this would be easy, but I cannot get the binding for a File Upload control to work..
 
Shouldn't this be as easy as selecting the File Upload control, go to the data section, choose simple data binding, choose the datasource (document), choose bind to (rtf field)?
 
I have an xpage with a datasource (document). On this xpage I have 5 fields (3 edit boxes, 1 rich text and 1 file upload control)
Binding has been set on all these fields to corresponding field on the datasource (document)
 
On my save button I do a document.save()
A full update is done.
 
Result:
The document is created and all fields contain the correct data, except the Rich Text field which is empty.. Should contain the attachment from the File Upload control...
 
I have checked all settings for upload file size settings etc.. ("Maximum size of request content" and "Maximum POST data" and XPages properties)
 
I get no error messages on the server console (or any other places..)
 
 Is there someting I'm missing here ? Banging my head into the wall over here....
 
 
Any information would be greatly appreciated !! Thanks :-)
 
 
regards,
Petter
 
 
 
Oct 7, 2011, 6:08 AM
56 Posts
Re: Cannot bind File upload control to Rich Text field...
Hello Petter,
 
usally it is as easy as you describe it.
 
You said you have a RichTextField and your FileUpload Control. I hope it is not binded to the same field in the document, if so, the content from the richText control could overwrite the attachment (maybe)
 Is your save button set up correctly?
 
<xp:link escape="true"
                                    id="linkSaveComplete" test="Save">
                                    <xp:eventHandler event="onclick"
                                        submit="true" refreshMode="complete">
                                        <xp:this.action>
                                            <xp:actionGroup>
                                                <xp:saveDocument var="document" />
                                            </xp:actionGroup>
                                        </xp:this.action>
                                    </xp:eventHandler>
                                </xp:link>
 
Try the simple action Save Document, you can also give a parameter which document should be saved, otherwise he chosses the "current"  document, which could be another than you wish.
 
Do you have more than one datasource in your XPage?
 
 
Oct 7, 2011, 7:13 AM
31 Posts
Re: Cannot bind File upload control to Rich Text field...
Hello Matthias,
 
Yes, i have 2 data sources. There are both spesified on a panel.
Panel1 has document1, and Panel2 has document2.
 
The save button is placed within Panel 2, and it¨s document2 that I try to save.
The default action for the data source for document2 is: Create document
 
The Rich Text field and the File Upload control is binded to different fields on the document/form.
 
I tried your code, but with the same result. The attachment from the File Upload control is not uploaded....
 
regards,
Petter
 
Oct 7, 2011, 7:55 AM
272 Posts
Re: Cannot bind File upload control to Rich Text field...
Hi Petter,
 
do you have  checked if there is any attachment data sent to the server in the uploaded request data ?
 
Sven
Oct 7, 2011, 8:53 AM
31 Posts
Re: Cannot bind File upload control to Rich Text field...
Hi Sven,
 
I ended up creating a new xPage and copied the code for data source (document2) + design to this.
 
I then ended up with 2 xPages (each with only 1 data source).
 
The exact same code is used for saving the document in the new xPage. Now, the attachment is uploaded..
 
So, ended up with a workaround which works. Will try to figure out my initial approach when I have the time...
 
Thanks for your feedback :-)
 
regards,
Petter

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal