Disable JSF page for few seconds on commandButton click - jsf

I need to disable all components of a jsf page on button click and show a countdown to , say 10 sec, before the page automatically refreshes.
Please share your ideas.

If you are willing to use any 3party component library.
Use Primeface BlockUI, which can be helpful in blocking UI components.

Related

JSF 1.2 checkbox How to get instant response?

I have a column of checkboxes and I want to get this effect that when you select 3 of them the rest of checkboxes disables. I've tried everything but I can't make it to do it instantly after clicking on a checkbox (it happens when I reload a page). Every response for that problem is using <f:ajax> but I'm using JSF 1.2 (and I can't use JSF 2 in this project). Is there any way to get through my problem?
Thanks in advance!

Modal launch button with actionlistener

I've been trying to use a f:setPropertyActionListener on a Bootstrap modal launch button but it doesn't work at all. Tags a and button don't support it so I don't know what to do now.
I need to set an id of an item in a bean I have when I push the modal launch button, so I can then confirm delete that item using the modal.
I've searched here and on other sites and I've found a lot of solutions to my specific problem using Javascript but I have no idea about that :/
Thanks in advance.

JSF How to display the Navigation confirm popup before forwarding to other page

I'm using Primfaces Layout component in my pages and I'm not using Redirection in navigation when user clicks on the Menu links.
i.e.,I'm NOT using faces-redirect?true and URL doesn't change when user navigates.
I want to display a Confirmation Dialog before user navigates away from current view, like
“Are you sure you want to navigate away from this page?”
So once user clicks on the OK then it should forward to other page or else it should stay in same page if user clicks on CANCEL.
One more constraint is I want this functionality for only few selected pages not all of them.
What is the best approach to deal with this problem?
Primefaces Version: 3.5
JSF Version: 2.1.13
All my ManagedBeans are in #ViewScoped
If you want to try solving this problem from javascript-side, either go with
window.onbeforeunload = function(e) {
return 'Dialog text here.';
};
and see the dialog independent from the link being clicked (see https://stackoverflow.com/a/12132076/1269441). or try adding
onclick="if (!confirm('Your dialog-text here')) {return false;}"
to a selection of links you would like to have the dialog shown.

JSF concurrency issue

When i hit a link a window popup is opened.I am having a session managed bean that loads a java.util.List.It is taking few seconds to load that list.
when i click the link twice i am getting concurrent modification exception. because the page is in session mode and first request is still loading the List, before it ends the second request tries to update the list.
I have two possible solution in hand
1) introducing synchronized block
Question : Introducing synchronized block leads to performance issue in multithread environment?
2) javascript to disable the link once it clicked.
problem : Not a good option because we need to restore the state of javascript once the popup is loaded. There is a possibility that the link is disabled forever if the popup window terminated abnormally.
Is there any other solution for this issue?
I'd choose option 1. synchronise on something in the session or on the session bean it's self. In a single server environment this should be pretty safe but in a cluster which isn't using sticky sessions you will have to look for a better singleton.
The performance shouldn't be effected as you will be synchronising for each user session for that particular session bean and if there is no contention the cost isn't worth thinking about.
One alternate solution is make the POPUP window modal window means the parent window will
be blurred/ overshadowed till Pop up is closed.
search for JavaScript code.
Choose 2nd option.
if you are using rich faces you can use a4j library of rich faces and rerender the popup link
<a4j:commandButton id="popupLinkId" onlick="window.open("popupLink");return false;" reRender="popupLinkId" />
Here a4j is the ajax for jsf rich faces library. Refer to http://livedemo.exadel.com/richfaces-demo/richfaces/support.jsf;jsessionid=B9DFBAF3AFD62C96B94EEC67FC4645A5?c=support&tab=usage link for further details.

How to create a popup for edit button in JSF page in jDeveloper 12c?

How to create a popup for edit button in JSF page in Oracle jDeveloper 12c?
There is nothing special about JDeveloper 12c when it comes to working with popups. You can see a sample here that automatically migrates to 12c:
http://andrejusb.blogspot.co.uk/2009/11/crud-operations-in-oracle-adf-11g-table.html
Drag and drop popup onto the form from component palette. Design as needed. Make note of popup ID. D&D Operation (from component palette) > Show Popup Behavior onto button. Set popup id to id of previously created popup. Select method to launch, like action. Google is your friend here. Search "ADF Popup" - lots of hits, like this. Remember to upvote those of us who take time to help you here.

Resources