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



Nov 3, 2011, 8:08 AM
9 Posts

'computed when composed' issue with @Unique

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: @unique
  • Replies: 1
I have a strange problem with a 'computed when composed' value when creating a document from an XPage:
 
I'm generating a unique reference for a document as follows:
On the form, the ID field is set to be computed when composed to a value of @Unique;
In the custom control there is an edit box with a simple data binding to the ID field on the form.
In all properties for the cc I have set computeWithForm to be onload.
 
What happens is that when the XPage is loaded to create a new document, I get my Unique ID displayed as expected (eg IADN-8N8LE8) but, when the document is saved for the first time this value is recalculated.
 
It's not really a show stopper because I can hide the value when creating the document but it seems very weird to me and I think I am missing something.
 
Can anybody shed any light on why this is happening?
Nov 7, 2011, 8:45 AM
261 Posts
Re: 'computed when composed' issue with @Unique
Phil,
 
Justed tested it and got the same results. This has to do with the fact that the document gets recalculated when it's saved (even when computeWithForm is set to "onload"). I've seen the same behavior in the past (before the XPage era) and it's probably by design.
 
If you add a (hidden) input field on your XPage (bound to the ID field) the value calculated during the onload is saved correctly.
 
Mark

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