404 Item not found When Providing access to existing documents from an XPage View - xpages

I have been following the tutorial here for creating an XPage application. Unfortunately I am encountering an Error 404 HTTP Web Server: Item Not Found Exception when you try to follow a link to another document from the main view XPage. Everything else seems to function properly until that point.
It happens when you select "XPage associated with the documents form".
According to some googling I simply needed to rebuild my project but that didn't work. That was the only fix I was able to find.
The link for my xpage for my view is : http://localhost/ExpenseClaims.nsf/xclaimsview.xsp
The link to a xpage with the 404 error from my view is: http://localhost/ExpenseClaims.nsf/%24%24OpenDominoDocument.xsp?documentId=15DA9966C77908D385257C150070483D&action=openDocument
The problem has returned for my "claim" xpage that represents a form document named "claim". My response documents open as needed.
My associations are:
Views: Xpage:
Claims -> xclaimsView
Forms: Xpage:
claim -> claim
response -> response

Most likely the connection between your XPage and the form didn't work. Open the form, then in the properties pick the XPage you want to open. Save it and try again.
There's one special case when you have an XPage with the same name as the form, where that should happen automatically, but it is safer if you specify the property in the form (second tab on the property box)

The data connection from the xpage to the form seems to be breaking down that's a possible cause but not an acceptable answer. The reasons are everything from the project build being broken to the port that domino designer is using as default being occupied.
Cleaning then building the project may help (Project -> Clean) but in my case it didn't. Opening the Page by selecting it by name is helpful but not if you are opening two different pages from the same view(View Properties -> at run time open selected document). There was another suggestion that said to move the default domino test port(File -> Preferences -> Domino Designer) but that didn't work for me.
The final answer was to go to each form's properties box and link it to it's corresponding xpage (second tab form properties). (see answer marked as correct for a link to IBM with a better explanation)

Related

Error accessing Xpage using $$OpenDominoDocument.xsp method on database replica

I have a Form called 'Contact Level\Customer Contact | Customer Contact', which is a response document, and in the properties I have associated the customerContact XPage to the form. In all view panel controls I have use the 'XPage associated with the document's form' property.
On server A the XPage is opened correctly using the $$OpenDominoDocument.xsp method from any view control.
On server B, which has a replica of the server A database, the XPage does not open from any of the views using the $$OpenDocumentDocument.xsp method. The error I see on the server log is 'HTTP Web Server: Item Not Found Exception [db.nsf/$$OpenDominoDocument.xsp?documentId=......&action=openDocument]'.
I have removed sections of code from the XPage to track down whereabouts the error is happening and it was the domino document settings that cause the problem.
I have checked the form properties and they are correct.
If I change the $$OpenDominoDocument.xsp section of the URL to customerContact.xsp then the document opens without error.
If I change the view panel property to explicitly open the customerContact XPage then again the document opens without error.
I have tried changing the form and XPage so it opens the 'contact' XPage instead (an almost identical non-response version of the same form) and the XPage still errored.
I tried saving a document in client but the XPage still errored.
I changed the form name to include a new alias of CustomerContact and modified a document to use the new form name, and this document opened without error. That made me wonder if the space in the Customer Contact name was causing the error, but there are many forms / XPages on the database in question, some others with spaces in there alias, and this is the only form that errors.
Any help would be greatly appreciated.
Is there another Form or Subform that has the same name or has "Customer Contact" as an alias? I have a feeling I read a blog some time ago that mentioned $$OpenDocument picking up a subform instead of a form, but I'm not 100% sure, so that may be wrong. If it's working on a newer server, that issue may have been fixed.

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.

Unable to get document page name for

I have a view that has XPage Associated with document form set.
The form property has the xpage associated with the document.
If I click on the link in the view the proper correct xpage is displayed as expected.
But if I close the browser, and paste the URL to the document into the browser, I get the error, Unable to get document page name for (and the unid). As long as I remain logged in the url will work without error or if I set anonymous to Reader the url will continue to work. But if I close the browser where I would be prompted to login then I get the error but I get the error before being prompted to log in.
The url for assocated forms looks a little different than when the view is used to display the xpage.
myserver/mydb.nsf/$$OpenDominoDocument.xsp?documentId=12B571F2B03E3764852573690041E273&action=openDocument
The view has various types of forms so I need to associate the form with the xpage or I suppose I can compute the xpage for the form. But any idea what would be causing this issue?
If you are opening a document from a view, the associated form could be overriden by a form formula of the view. When opening the document directly with $$OpenDominoDocument.xsp the original form stored in the document is used instead.
The form can be associated with a XPage in different ways:
For XPiNC there is a field $XPagesAltClient in the form
For web access there is a field $XPagesAlt in the form
There is a entry in the xsp.properties file.
For example this entry...
xsp.domino.form.xpage.foo=bar
...will open a document with the value foo in the Form field with the XPage bar.xsp.
Hope this helps
Sven

Opening different xpages forms from a view panel

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:.

#SetViewInfo - Issue when clearing filter

I have a problem that have me stumped.
I have been searching for a solution, but haven't found a working one yet. The solutions I seen introduces other issues.
Here is the scenario:
I have a frameset with two frames: 'Navigator' and 'Main'.
In the 'Navigator' frame I display a form called 'Navigator'. It contains an outline, to display a menu.
In the 'Main' frame I display the view selected by the user in the navigator.
So this is a very traditional Notes client application.
I now want to add a checkbox at the top of the view (in the action bar), allowing the user to filter the view by his/her own name. I use #SetViewInfo for this, and it all works perfect.
The issue is when the user switch views. The #SetViewInfo filter stays active when switching to a different view, so after some searching I found some solutions:
In http://www-01.ibm.com/support/docview.wss?uid=swg21204481 IBM suggests to put the following code in the QuerySave event:
#SetViewInfo([SetViewFilter]; temp ; 0 ;1)
When I am switching view or closing the view, I get the error message "Cannot execute the specified command".
In http://www-10.lotus.com/ldd/bpmpblog.nsf/dx/using-setviewinfo-in-a-notes-client-application-to-create-a-user-specific-view Andre Guirard suggests to put the following code in the QuerySave event:
#SetTargetFrame("frameName");
#UpdateFormulaContext;
#Command([OpenView]; #Subset(#ViewTitle; -1));
#SetViewInfo([SetViewFilter]; ""; "columnName"; 1)
I modify this to match my frame name and the programatic name of the first column in my view:
#SetTargetFrame("Main");
#UpdateFormulaContext;
#Command([OpenView]; #Subset(#ViewTitle; -1));
#SetViewInfo([SetViewFilter]; ""; "Adjuster"; 1)
This works perfectly when switching between view. But when I close the application while I am in this particular filtered view, the application is re-opened automatically. This happens no matter if the filter is enabled or not when closing the view.
However, when the view repopens, the frameset is not reloaded, it is just the view with the built-in view navigator to the left.
I finally got this to work by (in the built-in view navigator) selecting another view that the one where I filter data. This fixed the issue for a while, but then it starts again, and the filtered view is active in the navigator.
Obviously it is the OpenView command that is causing this, but if I remove just that line, I get the "Cannot execute the specified command" error again.
Any suggestions/pointers? I am using Notes 8.5.3 running on Windows 7 Professional.
This question can also be found in the IBM developerWorks forum for Notes 8.5:
http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllThreadedWeb/08c73910571306c485257b2b0061ef91
First thing, I would suggest to make sure your view frame is always called "NotesView". You will have much less compatibility issues if you do this.
Secondly, I presume when you say you put it in the QuerySave event you really mean the QueryClose event? Views do not have a QuerySave event.
Thirdly, I find the #UpdateFormulaContext line is not needed. This is what I have in my view QueryClose...
#SetTargetFrame("NotesView");
#Command([OpenView]; #Subset(#ViewTitle; -1));
#SetViewInfo([SetViewFilter]; ""; "<programmaticColumnName>"; 1)
And I can close the app while in the view without any problems.

Resources