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



Jun 30, 2011, 4:24 PM
129 Posts

Re: Detect refresh event on a view

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: view,events
  • Replies: 3
If I remember correctly, you can use getEntryCount to get the number of "filtered rows".
 
Not sure, but you could maybe use context.redirectToPage( '/nameOfXPage.xsp?action=openDocument&documentId=' + entry.getUniversalID() )  when there is only one row. If that doesn't work (not sure if partial updates can result in redirect), you could have a xp:scriptBlock that only shows when there is one row. document.location.href = "#{javascript:codeToComputeURL}".
Jul 1, 2011, 4:44 PM
13 Posts
Re: Detect refresh event on a view
Tommy, thanks for your post. 
 
I looked at your suggestions but am not sure if they really address the problem. Maybe I am not understanding or explaining.
 
I am able to get a handle on the number of documents in the view. The crux of the issue is how to fire a partial refresh on the data panel at the top of the form after the view is recomputed. The events go like this:  
 
The Xpage loads. The top 1/3 is a picture of the CEO and data. 
The middle 1/3 is a search field. 
The bottom third is a view. 
 
The user types something into the search field, which fires a partial refresh on the view and the view is subsetted.  
 
The user an at any time click on the data in column one (persons name) and that fires a partial refresh on the data panel, loading the person's picture and data.  
 
If the user continues to type and gets down to one element in the view I want to grab that UNID of the document, which I can do, and then fire the partial update on the data panel. 
 
But there are no events for a view? Can I add an event? There is a postopenView "event" in the data properties of the view. I got a long way coding that - got everything I need EXCEPT I can't fire a partial refresh because I am in SSJS.  
 
I am somewhat new to Xpages so sorry if this is actually easy or I misunderstood you. Any suggestions would be much appreciated!!! 
 
Bryan 
Jul 13, 2011, 4:23 PM
129 Posts
Re: Detect refresh event on a view
Sorry for the late reply. Forgot all about it.
 
The only way I think you can achieve this is if the search field refreshes both the view and the data panel.
 
In the beforeRenderResponse event (and maybe in the partial refresh of the field), you can check if there is only one document in the view / act accordingly. 

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