Welcome to the IBM Collaboration Solutions Community IQJam
UsernamePassword
Reset Password | Register
   
Home | Tags | Help
Equivalent of editDocument, openDocument, createDocument in data source definition 
Hello again,
 
I couldn't find info about what are the values of actiontypes - openDocument, editDocument and createDocument whe defining document data source in xpage. For example:
Code 1:
<xp:dominoDocument var="basket"
                                databaseName="#{javascript:sessionScope.productsDb}"
                                action="editDocument">
 
 Whe trying to programmaticaly choose the actiotype you get:
Code 2:
<xp:dominoDocument var="basket"
            databaseName="#{javascript:sessionScope.productsDb}">
           <xp:this.action><![CDATA[#{javascript:if (x==y) {return "createDocument"
                                                      } else {return "openDocument"}}]]>
           </xp:this.action>
 
So my question is - what value shoud I return in the second case (Code2) in the place of underlined code. Any idea?
Domino Development / XPages
Ana Dimova - over 3 years ago |  |  | Viewed 577 times

There are 2 answers

0votes
Unless I am misunderstanding your question, you return "editDocument" "openDocument" or "createDocument" ...
Jeremy Hodge - over 3 years ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community
2votes
When in doubt I usually use the wizards and see what they do to the code in the source pane. In this case action is "openDocument" or "editDocument". If you select "Create document" as the default action, xp:this.action is not included.
 
However, if you add xp:this.action, then go to the All Properties panel and look at the options in the drop-down for data for action, the option is "newDocument", so that looks to be the answer for creating a document.
 
if (x==y) {return "newDocument" } else {return "openDocument"}
 
As I'm sure you're aware, for openDocument/editDocument you'll also need to include documentId parameter. For creating a document I expect that will be a blank string.
Paul Withers - over 3 years ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community

Latest Answers for Domino Development / XPages 

How to call LS agent in xpage
Vijay Kumar - 7 months ago
Multi-values in an xPage view panel column
Judy Kilpinen - 8 months ago
From CSJS refresh a panel dijit.TooltipDialog
daniele grillo - about 1 year ago
How to get value from Repeater Control.
Atul Saxena - about 1 year ago
doing a partial update "beforepageload"
jeroen somhorst - about 1 year ago
How to get value from Repeater Control.
jeroen somhorst - about 1 year ago
How to get value from Repeater Control.
Mervin Thomas - over 2 years ago
Where Would I Delete My Cookie?
Lenni Sauve - over 2 years ago
Query_String value empty with agent URL from xpage
Andy Cunliffe - over 2 years ago
textfield formatting
Ben Poole - over 2 years ago
File Upload/File Download using Managed Beans
Toby Samples - over 2 years ago
File Upload/File Download using Managed Beans
Andy Cunliffe - over 2 years ago