Unresponsive buttons after certain time - xpages

Today we encountered a strange problem.
We have a XPage with some buttons, who id opened in editMode and bind to backend Notes Document.
We can press the buttons and the values are updated to the backend document. Via a partial refresh we see the new values.
So far so good.
But.. when we leave the XPage open for, let say 1 minute, without doing anything. After this period we try to click a button, we noticed that the button became unresponsive.
Is there a cause for this behaviour??

Never seen it happen in a minute, but there is a timeout setting in the server INI that defaults to 30 minutes, I think.

I see the same problem, but, not after a minute, but a few hours. I have an onclick event tied to a radio button and after a period of time, if I return back to browser clicking on the radio buttons does nothing...

Have you tried:
https://openntf.org/XSnippets.nsf/snippet.xsp?id=extend-partial-refresh-timeout
XSP.submitLatency = 120*1000;

Related

loading images or progress bar for typeahead in XPages

I have created an Xpages then put a editbox in it.
editbox has typeahead functionality. but some time It takes more than 5 seconds options to appear on editbox. During this 5 seconds i just want to make a loading progress screen on editbox or next to editbox.
is there any way to do this? any thought is important.
Thanks in advance
You can call a JavaScript function as soon the partial refresh of the typeahead is fired. A script to hijack the call can be found here: http://hasselba.ch/blog/?p=416
A timer can wait for a specific amount of time (e.g. 1 second), and then show a progressbar if the refresh is still running. If the call is completed hide the image.
Feel free to create a snippet of your solution and post it as a XSnippet.

Annoying delay before i can click a button after open an XPage

when I open an XPage with a lot of ssjs in it. I have always the problem, that when I click a button (with ssjs in it) directly after opening the page, nothing happens. When I wait 1 or 2 seconds, every thing works as expected. It seems, that not everything is loaded fast enough.
Is there an event to see if the document is completly loaded? I tried the jquery and dojo onready events and as well the onClientLoad event. But all these events trigert directly after the page is open (but not finish loaded).
You can add the following onClientLoad event as a client side javascript:
XSP.addOnLoad(new function() {
// this will run when everything is ready...
});
That's also why you see a lag for button events. All event handlers are binded via the same mechanism as above.
It was my fault. I just recognized that there are more than 30 panels there all have an empty onClientLoad method in it. After I removed the events, my page need to load 500ms insted of 2,5s and also the XSP.addOnLoad event to see if the page is ready now works as expected.
Thanks #Serdar Basegmez for your help.

JSF: Create a "dummy" button which does nothing?

In our JSF web application, we have an input field where the user can enter a numeric ID, which is then looked up by the app. To help the user, the lookup is bound to "onchange", thus it will be triggered as soon as the user tabs out of the field or clicks elsewhere.
So, user enters "123", presses tab (or clicks), lookup runs. This works fine; however, for usability reasons, we also want to provide a button that users can click on, for users who will otherwise wonder "where should I click to trigger a lookup?". To do this, we'd like to provide something that looks and feels like a HTML / JSF button, but does nothing (as the click will trigger the "onchange" event anyway).
Is there a way to make a JSF button that does nothing? I tried using h:commandButton without the "action" attribute, but it still fires a request.
p:commandButton type="button" will just provide a push button.
Since you tagged this question also as a usability issue, I would advise against a button in the first place if the onchange already triggers the lookup.
From a user's perspective it is confusing whether or not clicking the button is mandatory. After they have entered the field and skipped to the next, they see the lookup occur without clicking the button. If there is a button they will assume it's there for a reason.
The option that I favour in these cases is a onkeypress handler with a timeout of half a second, after which the value is looked up.

Can Popup page use DOM elements created in Background Page

Actually, I want to store some data in background page and the popup page just show that part of data say Data as a div element created in background page document.createElement("div"). Here, the background page will register some listeners to the tab update and change the Data elements accordingly. What the popup will do is to get that Data and appendit use the document.appendChild(Data).
(The purpose I intend is this will cause the popup changes immediately while the tab updage is triggered.)
However, the elements are shown as usual, what I am facing very headache is I have registered the onclick for the div object in backgroundpage as onclick="chrome.extension.getBackgroundPage().somefunc()". However, the first time, all the click will triger the right behavior but after the popup loses foucs and get focus again, all the click won't work.
I try to put something like change the onclick="somefunc()" and leave the func within the script of popup page. And there I want to log whether it is called by console.log("clicked"). Here, something unbelievable happens, the function is succefully trigerred BUT the console is null here, I cannot even call chrome.extension.getBackgroundPage() as well.
Here are a list of questions, maybe very hard to express for me...
1. Whether I can reuse the DOM element from the background page to the popup page directly by appendChild(chrome.extension.getBackgroundPage().getElementById()?
2.Will the onclick event registered in the background page still work in the popup pages?
3. What's the problem with the problem I am encountering? I have tried many ways to find out the reason but all in vain at last...
Best Regards,
If you need any more information, please let me know.
(PS: I am wonderning if it is called something like the event propogation, however, I am not an expert in this two pages communicating...)

UILocalNotification - Later

In my application I am using UILocalNotification which works fine. But I need "Later" button in the alert instead of "Cancel". When the user clicks on the "Later" button I want to show the notification after sometime. Is that possible?
Thanks
No man, you are on the wrong way.Due to the limitations of iphoneSDK such thing is not possible.In local notification it will only show the two buttons in alert View.
1)Cancel
2)View
Still you can rename the View button to you wish:
localNotif.alertAction = #"Snooze";
rahter than renaming the Cancel button.

Resources