jsf 2 - Block entire page -
When I change the page (pages 1 to page 2) there is a slight delay and it is possible to click on another button and These work go on. So I want to block the page during waiting time to load the following page, how do I do it?
I use jsf2 and primfaces.
At this time already blockUI and blockUI - extensions - & gt; Do not work
You should tell us. Why is Try it out This is a job. page1.xhtml page2.xhtml Demand Bean p: blockUI not working?
& lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! - To change this license header, select the license header in the project properties. To change this template file, tool | Open templates in templates and editors. - & gt; & Lt ;! DOCTYPE html & gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" xmlns: h = "http://java.sun.com/jsf/html" xmlns: f = "http: // Java Sun.com / Jsf / core "xmlns: ui =" http://java.sun.com/jsf/forums "xmlns: p =" http://primefaces.org/ui "& gt; & Lt; H: top & gt; & Lt; F: aspect names = "first" & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" /> & Lt; Meta name = "viewport" content = "user-scalable = no, width = device-width, initial-level = 1.0, max-scale = 1.0" /> & Lt; / Ch: Aspect & gt; & Lt; Title & gt; Page 1 & lt; / Title & gt; & Lt; / H: top & gt; & Lt; H: body id = "bodyView" & gt; Page 1 & lt; H: form id = "form1" & gt; & Lt; P: Editor id = "editor" widgetVar = "editorWidget" width = "600" /> & Lt; / H: form & gt; & Lt; H: form id = "form 2" & gt; & Lt; P: blockUI block = ": bodyView" widgetVar = "bui" /> & Lt; P: Command button icon = "Redirect" value = "Go to page 2" onclick = "PF ('buy'). Show ();" ActionListener = "# {blockView.redirect}" /> & Lt; / H: form & gt; & Lt; / H: Body & gt; & Lt; / Html & gt;
& lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! - To change this license header, select the license header in the project properties. To change this template file, tool | Open templates in templates and editors. - & gt; & Lt ;! DOCTYPE html & gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" xmlns: h = "http://java.sun.com/jsf/html" xmlns: f = "http: // Java Sun.com / Jsf / core "xmlns: ui =" http://java.sun.com/jsf/forums "xmlns: p =" http://primefaces.org/ui "& gt; & Lt; H: top & gt; & Lt; F: aspect names = "first" & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" /> & Lt; Meta name = "viewport" content = "user-scalable = no, width = device-width, initial-level = 1.0, max-scale = 1.0" /> & Lt; / Ch: Aspect & gt; & Lt; Title & gt; Page 2 & lt; / Title & gt; & Lt; / H: top & gt; & Lt; A: Body & gt; & Lt; H: form & gt; Page 2 & lt; / H: form & gt; & Lt; / H: Body & gt; & Lt; / Html & gt;
Import java.io.Serializable; Import javax.faces.bean.ManagedBean; Import javax.faces.bean.ViewScoped; Import javax.faces.context.FacesContext; Import javax.faces.event.ActionEvent; / ** * * @ Author Wittakarn * / @ViewScoped @ ManagedBean (name = "blockView") Public class BlockView serializable {Public Zero Redirect (ActionEvent event) applies {try {thread.leep (4000)); .. FacesContext.getCurrentInstance () getExternalContext () redirect ("page2.xhtml"); } Hold (Exception pre) {ex.printStackTrace (); }}}
Comments
Post a Comment