How to show document icon after picking file - google-docs

In app maker I have created a drive picker to add project files to a project tracking app. I have everything working the way I want to (thanks to some app maker samples & videos) except for the icon of the document. When I use the picker to select a file, or multiple files, the selected files are then shown in a list above the picker. File name, url link both work but icon will not show up. Any ideas? I've been working on this seemingly minor thing for hours with zero luch.
I have a model, called Files, set up. In it I have Name, Url, and Icon. In the properties for the picker, I have name and url bound to the appropriate datasource items and I have the following code bound to onDocumentSelect. I got that code from a video where a guy was doing basically what I'm doing except it worked on his. I've watched the video a hundred times probably to see if there's anything I did different.
widget.datasource.item.icon = result.docs[0].iconUrl;
widget.datasource.createItem();
This should retrieve the icon of the selected docs, after they're selected, and create the icon item in the datasource. What am I doing wrong? Or is there another or better way to do this?

Related

Copying and Renaming xhtml file to new file in JSF causing data does not load

I received an assignment to have a look at Java Server Faces project and maintain the existing code if possible. My background is ASP.net , and never made a Java program previously. The problem is like this : there is existing file code named policy_list.xhtml (with also several beans attached to UI component in the file) and lets say it attach to menu Policy List. If user click the menu, the policy_list.xhtml will show the list of Policy. I copied the policy_list.xhtml file and renamed it to a new file renewal_list.xhtml. And I created a new menu Renewal List and attach the link to renewal_list.xhtml. I did not make any changes to renewal_list.xhtml. However , when I click the Renewal List menu, the page did not show any data like the Policy List menu. There is no error shown in the page What is wrong with the Renewal List page. Is it the behaviour of JSF ? On the IntelliJ IDEA debugger, I have not found any error. However the Search button in the renewal_list.xhtml working fine just as policy_list.xhtml. All the action link in the dataTable does not work in renewal_list.xhtml. I guess I am missing as particular setup on the menu or else ? Any ideas ?
My God, I have to registered it on pages.xml . Now, its working. Thanks to the powerful search of IntelliJ idea.

Kentico clone and customize cms.file

Here's what I'm trying to do. When a user uploads a file, i need them to make one of three options. I'll then create a transformation to link to the file, with the option they selected determining the which icon.
I started with cloning the cms.file, and then created the new field i needed for the options. I then uploaded a file using that page type. I don't see my option list (Drop-down list) on the upload screen, or after the file has been saved.
I'm been playing with the Layout but that doesn't seem to help. What am I missing here?
You could create a simple page type that has a file upload field, that would solve your issue, and also you could include your extra field or fields in your new page type.
I'm not sure we have enough information to debug why your custom page type might not be showing the field you added, but a possible workaround: depending on what you are basing the icon on, it may work to just use different icons based on the file type? Kentico even has a method you can use to get a file icon based on the extension:
<%# GetFileIcon(Eval("FileExtension")) %>
Otherwise, maybe you can include some more information about your custom page type such as a screen shot of the fields and of the form tab for that page type. Is the "icon" field you added simply not showing up in the form?

Command Not Handled Exception

I'm new to Domino Designer. I'm trying to modify an existing application which is running on a remote server. I create a blank xPage and view in browser and it works. I add a label and view in browser and it works. I add a combo box and setup a data source for my xPage. The data source is in the current application and I'm using a view. I setup my combo to point to that data source and specify BindTo value. I view it in browser and I get Error 500 "HTTP Web Server: Command Not Handled Exception" I can open the view that I've used and see all the data in the view. I can even add, edit, and delete from the view.
Ideas... Thnxs in advance.
Additional Info. I've added a "View" from "Container Controls" and used the same data source and the same view and it also works in the browser.
The error being printed is:
javax.faces.el.PropertyNotFoundException: Error getting property 'CompanyName' from bean of type lotus.domino.local.View
com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:119)
com.ibm.xsp.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:144)
com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:182)
com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:163)
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.j‌​ava:257)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:150) ....
This was already answered in the comments, but I want to write a better answer.
The problem in this case is that a view data source is being used for editing a document. Directly, this is not a possibility, though there are a few great ways to get around this. The first way, and my favorite, is to use an inline form. I think the Extension Library Demo database offers a few great examples of how to go about doing this. One way is to use a tooltip dialog. Another way is an inline form. A repeater is used and for every row in the view, a hidden panel can be made which contains the document data source and all field which are required to be changeable. By clicking on a button or link, the panel is made visible. This is my favorite variant because it is simple, quick, and generally looks great.
Another way to go about this is to have a view data source only, but use scripts to retrieve the document and set the values in the background and then save and release. It all depends on what you are trying to achieve.
My main recommendation is to look at the ExtLib demo and take a look at what they are doing there.

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

Default content editor in list form doesn't allow image alignment

I need to be able to adjust the alignment of an image in an "Enhanced Rich Text Field" in an announcements list in MOSS 2007. However, the default content editor in the edit form for the list doesn't provide a way to do that. What's the fastest way for me to make sure users can align images? My first thought was to customize the DispForm.aspx and EditForm.aspx pages, but they just have the ListForm web part in the content region and as far as I know, you can't customize the ListForm web part from the designer.
You can't customize the LisForm web part, but you can add a "custom list form" to create a custom edit form. Maybe you haven't seen this article: http://weblogs.asp.net/jan/archive/2006/11/06/Custom-Edit-Forms-for-SharePoint-2007-Lists.aspx
Then you could do some javascript hackery to insert your own button which then calls something similar to existing RTE_InsertImage function to call a pop-up window and do whatever you need (you'll find this function in 12\template\layouts\1033\form.js)
I fail to see (or understand) your issue. I created a new announcements list, created a new item, inserted an image, aligned it to the right, viewed the item and it worked.
Then I proceeded to create a new custom column, choose multiple lines,enhanced rich text field, edited my list item, added an image, centered it, viewed and it was also working.
The only thing I noticed is that the "rich" control does not appears on non-IE browsers.

Resources