Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need syntax to call a refresh on one component from another on the page

Tags:

xpages

I have a fairly straightforward and common use case. A panel, in which resides a repeat control. The repeat control gets its content from a view lookup by key. Below that repeat control is another panel. This panel has a data binding to a new notesdocument. The panel has a couple of fields on it for the new document and a submit button.

It all works, however after submit (presumably in the "postSaveDocument()" event) I want to call back up to the repeat control and have it re-perform its lookup and refresh its content.

I'm looking to understand syntactically, how I can reference the repeat control and its properties and methods from elsewhere on the document -- and secondarily (though I can look this up once I get the first part figured out) what the refresh() method would be for that that repeat control.

Ideally, I think its something like: xp:page.repeatcontrolname.refresh() -- though I know that isn't right.

I'm sure once I see an example, it will apply to a myriad of other things.

Update :

I discovered that the repeated elements were actually refreshing but I wasn't seeing a new entry added to the list. The reason, ultimately, turned out to be that to add another entry to the repeat list I needed a new "control" -- but I'd checked that box (on the repeat control) that said "Create Controls at Page Creation". It was preventing my XPage from creating another entry for the new document to display!

like image 403
Andrew Pollack Avatar asked Mar 01 '12 19:03

Andrew Pollack


2 Answers

This article explains the syntax for doing what you describe:
http://avatar.red-pill.mobi/tim/blog.nsf/d6plinks/TTRY-84B6VP

like image 161
Tim Tripcony Avatar answered Sep 27 '22 19:09

Tim Tripcony


I have a feeling that this one captures the actual use case.

http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Create_and_display_responses

The key setting that people tend to miss is "ignoreRequestParams".

like image 39
Nathan T. Freeman Avatar answered Sep 27 '22 19:09

Nathan T. Freeman