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 20, 2011, 1:48 PM
66 Posts

How to prevent Domino to switch document to edit mode based on my condition?

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags:
  • Replies: 2
 How to prevent Domino to switch document to edit mode based on my condition? I have a list of documents, user opens the document in read mode (action=openDocument) and there is a button for switching document into edit mode. The button is created using Simple action and 'Change document mode' (this way Domino switches to edit mode using post method without changing the url to action=EditDocument ). I would like to prevent user to edit some documents despite the fact that he has an authors access. In standard Lotus Notes I ussualy place some conditions into PostOpen event and then close document, when condition is not being passed. In xPages, I tried here to place condition and context.redirectToPage code into 'beforeRenderResponse' event, but the redirect do not occur and there is no message on console. How should I accomplish requested behaviour?
 
Thanks!! 
Oct 21, 2011, 7:20 AM
261 Posts
Re: How to prevent Domino to switch document to edit mode based on my condition?
David,
 
How about setting the ignoreRequestParams parameter on the data source to true and then building your own logic to determine if the doument should be displayed in read or edit mode?
 
Mark
Oct 21, 2011, 11:12 AM
272 Posts
Re: How to prevent Domino to switch document to edit mode based on my condition?
Hi,
 
you could use an action group and compute the condition:
 
<xp:button value="Label" id="button2">
   <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
      <xp:this.action>
         <xp:actionGroup>
            <xp:this.condition>
               <![CDATA[#{javascript:if( document1.getItemValueString("author").equals("123") ) return true;
               return false
               }]]>
            </xp:this.condition>
            <xp:changeDocumentMode mode="toggle"></xp:changeDocumentMode>
         </xp:actionGroup>
      </xp:this.action>
   </xp:eventHandler>
</xp:button>
 
 
Hope this helps
Sven

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