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 29, 2011, 9:41 PM
4 Posts
topic has been resolvedResolved

Repeat/View Controls and Computed Values

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: Repeat Control,View Control,computed value
  • Replies: 2
I have a couple of questions regarding XPages and some Client Side JavaScript I'd like to write, but I am having some issues.
 
First Question:
If I am using a View Control or a Repeat Control and I am returning a dollar amount, lets call it total budget. Is there a way to add a computed field after the view control that will loop through all the documents in the view and perform a calculation so I can pull total budget and average budget amounts. Currently I have only had luck with redoing the search and then looping through the documents. This is takes too much time since I basically have to run the search over again, for each column I want to total. Just seems like there should be an easy way, to grab the view column and total it.
 
Second Question:
This may be a little more complex, but sort of basing it off the same concept as above. I have a SQL connection that runs a stored procedure. Currently I am using a repeat control and I am populating some information from Domino and would like to populate some from the SQL information. I am running a stored procedure and its returning values that look like this: value1^value2^value3^value4
I can access that information just fine, until I make that computed field not visible. Is there a way to make that data for each row of the repeat control accessible? I would hate to have to run SQL for each value for each row, seems excessive.
For instance, repeat control brings back 20 people. I would like to run the SQL 1x per row, then parse that data. As opposed to running it 4x per row.
 
Thanks for any help. Please let me know if you have any questions.
Thanks.
 
 
 


Nov 30, 2011, 1:03 PM
261 Posts
Re: Repeat/View Controls and Computed Values
Anthony,
 
There are a couple of approaches I can think of:
  • Define a viewScope variable in the beforePageLoad event and update it for every result within the repeat (by using a computed field for example).
  • In the "value" of the repeat, you first loop through the entire resultset and retrieve the information from it you need (before returning the resultset).
Mark
Nov 30, 2011, 7:46 PM
4 Posts
Re: Repeat/View Controls and Computed Values
Thanks Mark.
 
Doing everything in the repeat control value works perfectly.
 
Anthony

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