Richfaces showModalPanel function not working in IE when called from Iframe - jsf

I am having a richfaces app where pages would show a modal panel with a "Pls wait" message whenever some ajax processing is done. This works fine in IE and Firefox if used in separate web apps, but when I try to embed one web app into another webapp(like portals) and do the processing, it works only until a point where only ajax calls are submitted from the page. The moment a non-ajax call is invoked, the modal panel doesnt appear on the screen until screen refresh using F5. Specially this happens only in IE and works fine in FFox.

Related

Web Browser close button javascript

Working on web application and need to write some code in a web-browser close button, how can we do that in Javascript.
for Chrome, IE, and FireFox.
Just wants to override Close button code

Browser back button navigation

Whenever browser back is clicked, it must not navigate to the previous page but to some default page. how is it done using JSF ?
Clicking on browser back button requests the result page from the browser cache.
This is a client side activity. It doesn't send request to your server for fetching some default page(in your case).
Please refer this post for writing a filter indicating the browser not to cache dynamic JSF pages.
And also you can refer this one for more details.
You can try to detect if User has clicked on browser back button by writing client side code.
Refer this post for detecting back button click.
If you are trying to alter the behaviour of browser back button, it indicates some kind of flaw in your application.

XMLHttpRequest stops when my panel loses focus in google chrome

I am sending a xmlhttprequest from my google chrome ui after a button is pressed in the popup.html. This code works fine as long as the popup.html remains open. But the moment the popup.html closes(bu clciking the mouse outside popup.html area) the xmlhttprequest automatically aborts and stops. This causes my program to stop execution. I want to know if there is any way in which i can continue the xmlhttprequest even if the windows gets hidden and loses focus.
Your AJAX request should be done by a background script. Execution of this script can not be stopped easily by the user.
You should modify your extension like this:
user clicks something in the popup
popup calls a function from a background page
(from this place on popup is no longer needed to be open)
background page sends an AJAX call and retrieves the answer
(background page may ignore/store the answer form AJAX call or pass it to some content script/popup script etc.)

browser related question

I get different behavior between IE and Mozilla.
Say for ex I have 2 buttons on my webpage. Button-1 and Button-2
In mozilla browser, when I click Button-1 then it process the click request of Button-1, while it is processing the request, immediately if I Click on button-2, browser will not proceed request for Button-2.
In IE browser, after clicking Button-1 If I immediately click Button-2 then it will first process request of Button-1 and then it will process request for Button-2.
Why there is different behavior for both browser for same web page?
PS. IE 8 and Mozilla 3
Thats's life
Browser differences are one of the biggest hurdles in modern web development. You're best bet is to paste the code to let users take a look.

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