refresh notes uiview from web - xpages

A Lotus notes doucment is oepned in browser from a notes view. This is opened using xpage and after save and exit like to automatically refresh uiview to show the back end changes.
Any ideas how to accomplish this?
The application is running on 8.5.2 client and only few documents are opened in browser.

Your Save action could call (backend) view.refresh() method, but it is not recommended. This can lead to serious performance problems (semaphore locks on all http threads).

As sais in one of your comments it is opened by a new tab. In fact that makes it a bit easier. When you can create a client side action that mimics the opening of the document by just calling window.open() you can call its parent ( the page you're window.open originated from) to do something.
something like window.opener.document.getElementById()
( you have to google yourself for the correct syntax ).
This would give you the opportunity to call a partialrefresh on your view just before the child browser window is being closed.

Related

How does Blazor hijack the Browser-Back button?

Blazor-Server apps use the SignalR circuit.
I can somewhat understand how there is JS that change events happening from the DOM, so instead of sending a new HTTP GET request the framework manipulates the DOM and displays the new blazor page.
But how is it even possible that the circuit is still active and working on page back button? This is a BROWSER FEATURE, not some html element, which can be changed, right? Would it not be a security issue if the browser back button behavior can be manipulated in different ways?
Not firing a new HTTP GET request on page back seems pretty hacky. Wouldn't that allow for malicious websites to do the same? Can websites access the last page visited with that??
How does the browser "know" that the last page should also use the same websocket circuit?
Is it then possible to tell the browser that it should establish a websocket on a past page, that didn't even have any before (would seem like a security risk)?
How does the back button differ from hitting "enter" in the address bar (which will always cut and establish a new circuit)?
Is the back button exactly the same as calling JS history.back() ?

queryClose in xpages

I want to check user while closing xpage in XPiNC and web browser before closing and document e.g. displaying message do you want to save this document or not?
or other checks on different stages of workflow.
Kindly guide me the way forward to get this event in xpages.
Thanks,
Qaiser

After clicking Browser back button, BeforePageLoad-Code not run

My problem is that after clicking the Browser back button the code in the BeforePagesLoad-Event not triggered. There is a function to get set an object in a manged bean.
I dry to set the cache control to no-store but that don't work. the-order-of-events-in-xpages
Is there a way to trigger a event after clicking the browser back button?
I am no x-pages expert, but it looks to be a server side technology, meaning that a server call must be made in order for the code to run.
The first thread is a solution for forcing a page reload via cookies, while the second involves javascript/jquery. The second also may touch on some cache control of different browsers.
Force a page refresh when page visited from back button
Is there a cross-browser onload event when clicking the back button?

Serverside Xpages application update causes my browser page partial refresh actions stop working - how to detect it?

Any Xpages application update in design causes the application refresh which removes scope variables, session etc. When this occures and there is a page opened in users browser with some partial refresh action buttons ... such buttons simply do nothing when clicked which is quite confusing. No message that's warning the user that the page is stale or something. Is there a way how to detect such situation in general so I can inform user in browser with some dialog that he should reload the entire page?
For all scope variables above request (which gets initialized when you send a request and is always shiny and new) you never can take their existence for granted. Best example: user leaves a form open, locks the PC, goes for lunch, lets the session expire (which also deletes the view scope). (S)he comes back, opens a new tab and logs in - so there is a valid (new) session, hits submit in the first tab -> bum all your code fails.
This is the same scenario as an updated design short of the scenario Panu was pointing to.
So in your code check for the existence of your scoped variables and force a full refresh. Or (I like that better) add an error to the page so that gets displayed with an appropriate action.

Focus is not going inside EventHandler

I had created a simple web part with one label, and one button. I wnat that when i click the button the label content will change.
But when i debugg i found that the focus is not going inside the Button Click Event function.
When i click the button the debugger will again start with page load.
Is there any Autofocus for Button.
Please help me to resolve my problem.
Thanks :)
I think that you're confused about what happens on the client (within the browser) and what happens on the server (in your ASP.NET code).
Most events on server-side controls, like the ASP.NET button, are handled server-side, through a mechanism called postback. The generated code on the browser causes a form submit to the Web server, where the page and its controls are re-created. The form data is parsed and the button control generates (in your case) a Click event for your server-side code. This code regenerates a new HTML page which will replace the old one.
Fortunately for you in this case, the ASP.NET button has a property "OnClientClick" where you can insert JavaScript code to do whatever you want (like change the label text) directly in the browser.
See MSDN for the docs on the property and an example of using both Click and OnClientClick.
Note that this is not related to SharePoint, this is a pure ASP.NET issue.

Resources