Welcome to the IBM Collaboration Solutions Community IQJam.
UsernamePassword
Reset Password | Register
   
Home | Leader Board | 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 - about 1 year ago |  |  | Viewed 426 times

There are 2 answers

0votes
Unless I am misunderstanding your question, you return "editDocument" "openDocument" or "createDocument" ...


Jeremy Hodge - about 1 year 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 - about 1 year 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