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 16, 2014, 1:35 AM
41 Posts

Advice on creating a new document within a repeat control

  • Category: Extension Library
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 2

HI,

 

Am after a bit of advice on how to achieve an outcome. I'm developing a site for reviews, so the page has 1 repeat control which lists all the reviews entered.  In each review readers will get the opportunity to compose their own reviews.

I've tried creating a new panel underneath the existing reviews (another repeat control) with the datasource being the userreview form,, but come across a couple of problems. Firstly, if I put in field validation, it validates all the fields (eg name) for all the other reviews. Secondly, once I hit submit, the review document is still in memory, so if the user (with anonymous access - author only) hits submit again, they will get an error. Have set the submit button to partial or full refresh, but the same result.

 

If there is a better way to achieve the same result, or some other examples, be grateful for any ideas.

 

Thanks in advance

 

Cameron

Oct 16, 2014, 2:45 PM
453 Posts
I do something like this in one of my applications

What I did is create the new document in a dialog box (I use the one from the extension Library. The user composes the new document then clicks submit. In the submit button. after doing all the checking etc take the dialog down. That should isolate the validation to just the dialog (but I have not tried that explicitly) should isolate the document that you are creating to the dialog. Frankly I have not been able to get validation to work very well so that it only validates when the document is saved. In native Notes I tended to do all that validation in the QuerySave Event and found that, for me, that works better. I then return the the results in a viewScope errorMessage and display it if the save fails. There appear to be issues with the sequence of the validation messages (they don't appear in the same order as the fields are on the page) so by doing it all in the QuerySave I can control that plus if you have a a fair bit of logic in your validation I find it easier to maintain because it is all in one place. Others might disagree, but I have not seen a good answer. 

On another point I'm not sure how you are keeping the documents related I do it by creating a field in the main document (I call it LinkKey) and set it to @Unique() then store that value if each of the 'responses'. I used to use the parent UNID but that generates all manner of problems if a save/rep conflict every happens, or if you wish to archive documents because the UNID changes. 

Oct 17, 2014, 9:40 PM
41 Posts
Use of popup

Hi Bill,

 

Thanks for the suggestion, but am trying to keep the design as flat as possible. Popups aren't that great on mobiles. For the moment, I've created another page, with a link below the review, to write user reviews.

 

Am linking by parent docID, but using a field storing the docID that is computed when composed, so never changes (have had this on every form I've designed in Notes for years).  This works fine for archived documents, as the field itself is the key, not using a formula like @text(@documentUniqueID), and doing lookups (also excluding rep/save conflicts) to a view sorted by this field.


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